VIP
- Joined
- Apr 23, 2018
- Messages
- 1,071
TL;DR
Due to their use of
tags, the bbcode
ATM, CANNOT contain:
which use
tags.
This limitation can be removed by changing the tag generated by the bbcode from
to something else, like
JSFiddle showing suspected problem and proposed solution.
Relevant W3C Documentation:
[ul][*]Tag omission rules (implicit tag closing). Note all tags listed above are listed as tags that implicitly close <p> tags.
[*]List of elements allowed inside <p> tags.
[/ul]
If this is unlikely to be fixed soon, or believed not to be the cause of the problem, please let me know.
Nesting with paragraphs is NOT possible in HTML! Paragraphs/Phrasing content (like
tags) are NOT allowed to contain most other elements in normal HTML. In fact, attempts to do so will generally implicitly close the
tag.
However, some of MD formatting uses
tags as the container.
for example. These formatting tags will suffer from this as they may not contain
tags, which are used by
bbcode.
As you can see, there are several invalid combinations of bbcode because of this. Many are aware of the spoiler in spoiler limitation, some are aware of the spoiler quote limitation as well.
Here is an example of the problem.
BBCode:
Likely bbcode parser generated HTML:
What MD ends up outputting after an HTML engine corrects it (either on their end, or the client's browser. Either way, what was generated is considered invalid):
Actual result, regardless of how close I got to the process:
Due to their use of
Code:
<p>
Code:
[[s][/s]spoiler] [[s][/s]left] [[s][/s]center] [[s][/s]right]
Code:
[[s][/s]spoiler] [[s][/s]left] [[s][/s]center] [[s][/s]right] [[s][/s]h1-h4] [[s][/s]hr] [[s][/s]ol] [[s][/s]ul] [[s][/s]quote]
Code:
<p> <h1-h4> <hr> <ol> <ul> <div>
This limitation can be removed by changing the tag generated by the bbcode from
Code:
<p>
Code:
<div>
JSFiddle showing suspected problem and proposed solution.
Relevant W3C Documentation:
[ul][*]Tag omission rules (implicit tag closing). Note all tags listed above are listed as tags that implicitly close <p> tags.
[*]List of elements allowed inside <p> tags.
[/ul]
If this is unlikely to be fixed soon, or believed not to be the cause of the problem, please let me know.
Overly verbose way to say the same thing below
Nesting with paragraphs is NOT possible in HTML! Paragraphs/Phrasing content (like
Code:
<p>
Code:
<p>
However, some of MD formatting uses
Code:
p
Code:
[[s][/s]spoiler] [[s][/s]left] [[s][/s]center] [[s][/s]right]
Code:
<p> <h1-h4> <hr> <ol> <ul> <div>
Code:
[[s][/s]spoiler] [[s][/s]left] [[s][/s]center] [[s][/s]right] [[s][/s]h1-h4] [[s][/s]hr] [[s][/s]ol] [[s][/s]ul] [[s][/s]quote]
As you can see, there are several invalid combinations of bbcode because of this. Many are aware of the spoiler in spoiler limitation, some are aware of the spoiler quote limitation as well.
Here is an example of the problem.
BBCode:
Code:
[[s][/s]spoiler][[s][/s]center]I swear I used spoiler tags!!!! Why is it still visible!!!!![[s][/s]/center][[s][/s]/spoiler]
Likely bbcode parser generated HTML:
Code:
<button type="button" class="btn btn-sm btn-warning btn-spoiler">Spoiler</button>
<p class="spoiler display-none">
<p class="text-center">I swear I used spoiler tags!!!! Why is it still visible!!!!!</p>
</p>
What MD ends up outputting after an HTML engine corrects it (either on their end, or the client's browser. Either way, what was generated is considered invalid):
Code:
<button type="button" class="btn btn-sm btn-warning btn-spoiler">Spoiler</button>
<p class="spoiler display-none"></p>
<p class="text-center">I swear I used spoiler tags!!!! Why is it still visible!!!!!</p>
Actual result, regardless of how close I got to the process:
I swear I used spoiler tags!!!! Why is it still visible!!!!!