Generally, a span that contains "\n" in it is considered invalid, so you shouldn't be using this method when creating your document. The proper way to add a line break would be the second approach you mentioned - inserting FormattingSymbolLayoutBox.LINE_BREAK
. The ¬ character, on the other hand, is the symbol used for adding line breaks in the document.
So, a correctly structured document would look something like this:
Section section =
Paragraph paragraph1 =
Span span1 =
"Some text in the first span. "
Span span2 =
"Some more text after the line break in the same paragraph."
Paragraph paragraph2 =
will indeed contain the ¬ character when exported to XAML, for example.
I also tried exporting to PDF the document above and it all looks good on my end. Can you please verify that and contact us again if you are observing different behavior?
Let me know how it goes.