Bug 812716

Summary: Whitespace is added when saving a topic
Product: [Community] PressGang CCMS Reporter: Lee Newson <lnewson>
Component: CCMS-CoreAssignee: Lee Newson <lnewson>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.1CC: mhusnain, misty, topic-tool-list
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-09 00:00:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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