Page MenuHomePhabricator

Text breaks out of p tag unexpectedly
Closed, DuplicatePublic

Description

The following code displays the external links symbol:

<p>
A
</p><p class="plainlinks">
[https://github.com/Nikerabbit GitHub]
</p>

because the resulting HTML is:

<p>
A
</p><p class="plainlinks">
</p><p><a rel="nofollow" class="external text" href="https://github.com/Nikerabbit">GitHub</a>
</p>
<p></p>

This looks completely unexpected to me and seems only to happen when whitespace is place in this way.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 21 2018, 4:35 PM

Parsoid does the right thing:

[subbu@earth:~/work/wmf/mediawiki] parse.js --normalize=parsoid </tmp/wt

<p>A</p>
<p class="plainlinks"><a rel="mw:ExtLink" class="external text" href="https://github.com/Nikerabbit">GitHub</a></p>

But, this is another instance of T134469: doBlockLevels() inserts <p> and </p> randomly with no regard for HTML validity.