TextFormatter: phpBB: excessive

in content block

I’m not exactly sure that my issue belongs to TextFormatter, or to it’s phpBB integration part.

Anyway, when I use Markdown extension, I see that content block of forum post is whole wrapped into additional <p> tag.

And in my setup it causes problem (conflict with bbcode).

So I want to ask: is it feature of Litedown plugin? Or something wrong in phpBB?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 30 (13 by maintainers)

Most upvoted comments

The createParagraphs rule works as intended and no paragraph is created inside of the spoiler. You can verify that by looking at the page’s source: (not “Inspect element”)

<p><span class="spoiler"><input type="button" value="title" class="button2" style="font-size:10px;margin:0 5px 0 5px" onclick=" if(this.parentNode.getElementsByTagName('div')[0].style.display!='') this.parentNode.getElementsByTagName('div')[0].style.display=''; else this.parentNode.getElementsByTagName('div')[0].style.display='none';  "><div class="spoilercontent" style="margin:3px 0 0 0;padding:5px;border-width:1px;border-style:dotted;display:none">text</div></span></p>

The reason you see a different DOM tree when inspecting the element is because the markup is invalid and this is the way browsers must handle invalid markup as per HTML 5. span does not allow div so the div is moved to the parent, but p doesn’t allow it either and it is moved up further. I don’t know off the top of my head why an empty paragraph is created but since Chrome and Firefox behave the same way I assume it’s as per the HTML 5 specs.

If you replace the span with a div it should fix your markup.