C-C-C-Combo breaker!
-
To repro:- Do what I did in the raw of this post: https://what.thedailywtf.com/post/1048788
The generated markup:
-
@RaceProUK
Wat?
I've seen markdumb do some dumb things, but that may be the dumbest yet.
-
@HardwareGeek I think this is also the first time I've found a bug while reporting a bug.
No idea how I did tha- oh yeah, long hiatus...
-
@RaceProUK said in C-C-C-Combo breaker!:
I think this is also the first time I've found a bug while reporting a bug.
First time you've done that, maybe, but it's certainly happened to other people.
-
I had a bug that kept me from reporting the bug I found.
-
@thegoryone Fuck!
That hurt.
Where the hell did you get that advice?!
-
Alright, please write HTML that you think that should render to. Because you end up with something like
<p><small></p><ul></ul></small>
, which doesn't make any sense.
-
@ben_lubar
<p><small>...</small></p><small><ul>...</ul></small>
?
-
@CreatedToDislikeThis neither ul or li tags are phrasing content, and thus are not technically permitted inside a small tag.
-
@Arantor Does it have to go the other way around?
<li><small>Item</small></li>
?
-
@Yamikuronue yes, small is phrasing content but can exist inside either phrasing or flow content (li is flow content)
-
So then
<small> To repro: - Scroll to very bottom of page - Open composer - Type part of an emoji - Scroll down more </small>
Should render as:
<p><small>To repro:</small></p> <ul> <li><small> Scroll to very bottom of page </small></li> <li><small> Open composer </small></li> <li><small> Type part of an emoji </small></li> <li><small> Scroll down more </small></li> </ul>
Or possibly
<p><small>To repro:</small></p> <ul> <li><small> Scroll to very bottom of page </small></li> <li><small> Open composer </small></li> <li><small> Type part of an emoji </small></li> <li><small> Scroll down more </small></li> </ul> <p><small></small></p>
because of the final
\n
-
....why is that red?!
-
-
@Yamikuronue
<code class="hljs diff">
Weird language guess by the code block, probably from the leading
-
on most of the lines-some text +some other text
-
@Yamikuronue Add
html
after the first triple backtick:<small> To repro: - Scroll to very bottom of page - Open composer - Type part of an emoji - Scroll down more </small>
Also works with other languages
-
@RaceProUK or
markdown
...<small> To repro: - Scroll to very bottom of page - Open composer - Type part of an emoji - Scroll down more </small>
-
@anotherusername or
xml
<small> To repro: - Scroll to very bottom of page - Open composer - Type part of an emoji - Scroll down more </small>
-
@RaceProUK given that it is markdown, that seems like the logical choice though. :P
-
Or
text
if the colours annoy you<small> To repro: - Scroll to very bottom of page - Open composer - Type part of an emoji - Scroll down more </small>
-
-
@Arantor said in C-C-C-Combo breaker!:
@Yamikuronue yes, small is phrasing content but can exist inside either phrasing or flow content (li is flow content)
Ok, so should I remove the part of the htmlcleaner plugin where it puts inline tags into
<p>
?
-
@ben_lubar html is hard :P technically... you can have both phrasing and flow content inside a div, so that's fine - you don't need to rewrap it.
I'm inclined to agree that you don't need it, though it's a useful way of forcing a certain amount of scope on an element going rogue, e.g. unclosed small tag which will be implicitly closed by the p tag owing to the change of scope. A div would have the same effect, but trying to guess what a user's intent is... is hard.
To really do it properly you need to decompose the content back to a syntax tree and traverse it like a DOM.
-
@Arantor said in C-C-C-Combo breaker!:
To really do it properly you need to decompose the content back to a syntax tree and traverse it like a DOM.
That's what htmlcleaner does.
-
@ben_lubar Huh, TIL.
Well, OK, then if you're decomposing back to a syntax tree, inline tags that are phrasing content do not need to be rewrapped into p tags. It's only flow content when you need to think about this.
-
@ben_lubar said in C-C-C-Combo breaker!:
@Arantor said in C-C-C-Combo breaker!:
@Yamikuronue yes, small is phrasing content but can exist inside either phrasing or flow content (li is flow content)
Ok, so should I remove the part of the htmlcleaner plugin where it puts inline tags into
<p>
?I'd think it'd be perfectly sufficient to just let it be
<small><p>To repro:</p><ul><li>**Snip**</li></ul></small>
and then let the browser figure out how it wants to render that.
Or if htmlcleaner puts that in, and it turns into
<p><small>To repro:</small></p><ul><li><small>**Snip**</small></li></ul>
...that'd be fine too.