Log in

View Full Version : Soft line breaks dont respect bold, italic and underline formatting



Zarestia
May 29th, 2021, 17:28
As I am writing my adventure module I came upon some formatting problems. I can replicate these in a fresh campaign without extensions. Soft line breaks seem to cause issues with bold, italic and underline texts. Hard line breaks work fine.

For testing I mixed the line break method to better illustrate the error.
Before reloading the campaign:
https://i.imgur.com/HjbGhB9.jpg

After reloading the campaign:
https://i.imgur.com/jpQ24l8.jpg

Ecks
May 29th, 2021, 18:42
This thread may be related: https://www.fantasygrounds.com/forums/showthread.php?68262-Extra-spaces-added-around-formatted-text-when-there-are-adjacent-characters

When adding a new line via SHIFT+Enter, a carriage return code (#&13) is inserted and looks like this in db.xml (backslash before ; character added to be able to post output):

<p><b>Bold</b> text&#13\;<b>Bold</b> text&#13\;<b>Bold</b> text</p>

Similar to in the other thread, on reload a space is added before each <b> tag, which results in the extra space you're seeing. In db.xml after:

<p><b>Bold </b>text&#13\; <b>Bold </b>text&#13\; <b>Bold </b>text</p>

Zacchaeus
May 29th, 2021, 18:47
Indeed. I think this has been know about for some time. I have the same issue when using par5e hence I have to enclose any punctuation within the tabs to avoid this , So I have to <b>this,<b> - in other words bold the comma as well. So when using the line break I'd include that inside the tags as well <b>1st line@#13;\</b>Second Line

Zarestia
May 29th, 2021, 18:49
This thread may be related: https://www.fantasygrounds.com/forums/showthread.php?68262-Extra-spaces-added-around-formatted-text-when-there-are-adjacent-characters

When adding a new line via SHIFT+Enter, a carriage return code (#&13) is inserted and looks like this in db.xml (backslash before ; character added to be able to post output):

<p><b>Bold</b> text
\;<b>Bold</b> text
\;<b>Bold</b> text</p>

Similar to in the other thread, on reload a space is added before each <b> tag, which results in the extra space you're seeing. In db.xml after:

<p><b>Bold </b>text
\; <b>Bold </b>text
\; <b>Bold </b>text</p>

You're right, I just skimmed through your post as I read it when it was posted. Well, then I take Moon Wizard's response is probably the same for my observings. Hard line breaks are the way to go then for anything not raw text.

EDIT: Thanks @Zacchaeus for the tips!