pretty printing inserts newline before closing tag bracket

Having trouble installing Oxygen? Got a bug to report? Post it all here.
shuphi
Posts: 7
Joined: Wed Jul 26, 2006 11:24 am
Location: Zurich/Switzerland

pretty printing inserts newline before closing tag bracket

Post 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.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post 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
shuphi
Posts: 7
Joined: Wed Jul 26, 2006 11:24 am
Location: Zurich/Switzerland

Post 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
Post Reply