Bug 812716 - Whitespace is added when saving a topic
Summary: Whitespace is added when saving a topic
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: PressGang CCMS
Classification: Community
Component: CCMS-Core
Version: 1.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Lee Newson
QA Contact:
URL:
Whiteboard:
: 997675 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-04-16 04:17 UTC by Lee Newson
Modified: 2013-09-09 00:00 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-09-09 00:00:35 UTC
Embargoed:


Attachments (Terms of Use)

Description Lee Newson 2012-04-16 04:17:37 UTC
If you save a topic and then alter it within the GUI editor on non inline elements then a space gets added to the end of the each text node.

ie

Saving the following will add spaces after "JBoss Enterprise SOA Platform" and "Window1" even though none exist.
----------------------------------------------------
The 
<application>
	JBoss Enterprise SOA Platform
</application> server is launched in 
<systemitem>
	Window1
</systemitem> and then the 
...
----------------------------------------------------

Part of this also shows two more elements that should be declared as inline by skynet.

<systemitem> and <application>

Comment 1 Lee Newson 2012-04-16 05:01:32 UTC
The problem is caused by the tabs on the next line since any whitespace between the end of the sentence and next node is compacted down to a single space. The tabs and other whitespace is then reconstructed.

I haven't come up with a valid fix yet, however adding the "systemitem" and "application" elements as inline elements fixes the issues that discovered the bug.

Comment 2 Lee Newson 2012-06-27 04:45:49 UTC
I've done a partial fix to do with this, so that anything that has spaces between two XML elements are preserved.

Ie the space between "</application>" and "<systemitem> will be preserved:

<application>JBoss Enterprise SOA Platform</application> <systemitem>Window1</systemitem>

The main problem still exists though.

Comment 4 Lee Newson 2013-08-16 03:13:53 UTC
*** Bug 997675 has been marked as a duplicate of this bug. ***

Comment 5 Lee Newson 2013-08-16 06:19:35 UTC
Fixed in 1.1-SNAPSHOT build 20130816-1558.

The whitespace will now be removed from the start where not applicable. So taking the following input:

<para>
The 
<application>
	JBoss Enterprise SOA Platform
</application> server is launched in 
<systemitem>
	Window1
</systemitem> and then the 
</para>

Here is the output:

<para>
    The <application>JBoss Enterprise SOA Platform</application> server is launched in <systemitem>Window1</systemitem> and then the
</para>

See commit: https://github.com/pressgang-ccms/PressGangCCMSCommonUtilities/commit/d7ef3425b945acf5d6e6ac8bf6c77aa06087ae92


Note You need to log in before you can comment on or make changes to this bug.