HomePhabricator

Create Parser::stripOuterParagraph to avoid code duplication

Description

Create Parser::stripOuterParagraph to avoid code duplication

We've had the logic for stripping the outer <p/> element in three
separate places. The version in OutputPage was missing the '$' at the
end of the regex, that was most likely a mistake caused by the
duplication.

Also, extend the logic in order not to generate invalid HTML if the
input contains more than one <p/> tag. Added tests for this and the
previous behaviour.

https://www.mail-archive.com/mediawiki-api@lists.wikimedia.org/msg03188.html

Change-Id: I6bb3597898324556df912a23a7ffc9ff250b8f58

Details

Provenance
matmarexAuthored on
AnomieCommitted on May 15 2014, 4:20 PM
Parents
rMWee9d87560773: Merge "Check for Language::getSpecialPageAliases returning null in…
Branches
Unknown
Tags
Unknown
ChangeId
I6bb3597898324556df912a23a7ffc9ff250b8f58