Open Ambient-Impact opened 3 years ago
I think I've figured this out! Turns out that it was indeed the <p>
elements that were causing this; removing them seems to have restored the expected behaviour. I also tried adding 'p'
to Caxy\HtmlDiff\ListDiffLines::listContentTags
which also fixed it, so perhaps this element could be added to that array? According to the MDN entry for <li>
, <p>
elements and a few others that count as "flow content" are allowed in list items.
@SavageTiger Thoughts?
@Ambient-Impact This was a long time ago, I know, but I'm curious if the
tags were getting removed by the HTML sanitizer / purifier that runs I wonder... as you mentioned in theory
tags should be fine within
This does feel like a lifetime ago. 😂
I don't know enough about what's handled by this library and what's handled by the purifier, but I'm guessing the oversight is probably because it's not a common thing to want to put <p>
inside a <li>
intentionally - I don't think I knew it was valid until I looked it up.
I've got the following two blocks of HTML being marked as changed, even though I've diffed them with WinMerge and it tells me they're 100% identical.
Block 1:
Block 2:
Could it be due the emoji or the
<p>
elements? Not sure if the<p>
elements are valid nesting, so I'll likely try to remove those, but they're being automatically generated by CommonMark or a Drupal filter.