Page 1 of 1

pretty printing inserts newline before closing tag bracket

Posted: Wed Jul 26, 2006 11:39 am
by shuphi
Pretty-printing inserts a newline character before the closing angle bracket of starting tags of mixed elements, if the first node of the content is a text() node.

Example Structure:

[...]
<para>
<language lang="en">
mixed <e>text</e> with inline formatting
</language>
</para>
[...]

Result after pretty-printing:

<para>
<language lang="en"
>
mixed <e>text</e> with inline formatting
</language>
</para>

If, however, the language element content starts with a inline tag, e.g.

<language lang="de">
<e>inline</e> and some text
</language>

the markup is formatted correctly.

Apreciate any help to get rid of this, as it may confuse inexperienced editors.

Posted: Wed Jul 26, 2006 12:46 pm
by sorin_ristache
Hello,

I do not really understand how you get that result from the pretty print operation. The pretty print operation breaks the line between the last attribute and the closing angle bracket only if the line width limit set in Options -> Preferences -> Editor / Format is between the end of the attribute and the closing angle bracket. Also it can happen if the first text node which is child of language does not contain whitespace characters and the end of this text node is after the limit set by the line width option, something like:

Code: Select all

<language lang="en">longTextHereWithoutWhitespaceAndAfterTheLineWidthLimit<e>text</e> with inline formatting
</language>
But your example is not in this case because there is a space character between mixed and <e> and also between </e> and with. If the language element is added to the preserve space elements in Options -> Preferences -> Editor / Format / XML then the break does not occur before the closing angle bracket. Please specify your pretty print options set in Options -> Preferences -> Editor / Format and Options -> Preferences -> Editor / Format / XML and post the example code indented exactly as in the editor panel (when you edit your post press the Code button twice to insert code tags in the post which keep the indenting of the sample code, for example

Code: Select all

<language lang="en"> ... 
).

Regards,
Sorin

Posted: Wed Jul 26, 2006 1:46 pm
by shuphi
Thank you so much, it works! I'm really fond of the new oXygen version I'm evaluating since yesterday, and I guess I'll soon purchase it!

regards, Gerhard