bbcode icon indicating copy to clipboard operation
bbcode copied to clipboard

Newline after [list] generates invalid HTML

Open eazrael opened this issue 6 years ago • 2 comments

[list]
[*] Reduced enemy count in Furies Wings
...

will be converted to

<ul><br/>
</li><li> Reduced enemy count in Furies Wings<br/>
...

The line break after the <ul> is in a <li> tag which never was opened.

My proposal is to add something like "allowedChildTags" to the Tag class, so that after opening a list only [*] [li] is allowed. No idea what to if that is not the case. The keepLines behaviour needs also to be adapted.

eazrael avatar Feb 16 '19 10:02 eazrael

Hello,

thank you for your feedback.

Well you will always be capable of writing BBCode that will result in HTML code that a HTML validator would call "incorrect". I did not even try to solve that problem - that's too much of a challenge. But you are right, this is such a big problem that I am willing to classify it as a bug.

I have to dig into the code to really understand why this happens.

chriskonnertz avatar Feb 19 '19 14:02 chriskonnertz

Hi, thanks for accepting this as a bug. I think this is nothing uncommon to separate the list tag and the items with new lines, so I assume it should have been hit before.

eazrael avatar Feb 20 '19 22:02 eazrael