Bug 812716 - Whitespace is added when saving a topic
Whitespace is added when saving a topic
Status: CLOSED CURRENTRELEASE
Product: PressGang CCMS
Classification: Community
Component: CCMS-Core (Show other bugs)
1.1
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Lee Newson
:
: 997675 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-16 00:17 EDT by Lee Newson
Modified: 2013-09-08 20:00 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-08 20:00:35 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Lee Newson 2012-04-16 00:17:37 EDT
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 01:01:32 EDT
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 00:45:49 EDT
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-15 23:13:53 EDT
*** Bug 997675 has been marked as a duplicate of this bug. ***
Comment 5 Lee Newson 2013-08-16 02:19:35 EDT
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.