Page MenuHomePhabricator

DiscussionTools marker-comment appears after Parsoid's expansions of wikitext extension tags and causes p-wrapping
Closed, ResolvedPublic

Description

DiscussionTools marker-comment appears after Parsoid's expansions of wikitext extension tags and causes p-wrapping.

The problem occurs only on talk pages, and in namespaces listed in wgExtraSignatureNamespaces (which includes the main namespace on some projects like Meta).

Example:

Caused by https://gerrit.wikimedia.org/r/c/mediawiki/extensions/DiscussionTools/+/713681

Event Timeline

From https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/723592/1#message-94e58c7427d45529f33f1cb3026cf7a0aed89916

php bin/parse.php --pageName Talk:Fortnite --oldid 1045069631 --dump extoutput < /dev/null |& less 

That shows that this comment is added in multiple places, but (you cannot see this in this dump) all exts except the <syntaxhighlight> one don't have the outer <p> wrapper in the output ... so, this patch only ensures that the p-wrapper stripping continues to work. 

If we want to actually strip out that trailing comment in all cases, we'll probably need more careful work, since in the general case, we don't know if that trailing comment is actually added by the extension or by the parsing code in core, and we don't want to hardcode for specific comment values either.

The comment itself should be harmless since it is rendering-transparent and pretty much all passes ignore them. There may be the occasional extra newline in output. But, we can separately investigate if there is a way to have the parse call to core not add this comment by passing in an appropriate flag / option.

So, the DT comment will continue to show up in output. If those need to be stripped, we need to find a different solution to prevent it from being added in the first place.

matmarex added a subscriber: cscott.

@cscott and I were thinking that DiscussionTools should add to the the parser limit report instead of adding its own comment, which would also fix this issue. I'll try to implement that.

Change 724170 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/DiscussionTools@master] Replace marker comment with limit report data

https://gerrit.wikimedia.org/r/724170

Change 724170 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Replace marker comment with limit report data

https://gerrit.wikimedia.org/r/724170