ApiDiscussionToolsEdit: Unwrap Parsoid sections before parsing

Otherwise, when a transclusion covers a section boundary, both whole
sections are considered to be transcluded.

We already use this method everywhere else (by way of
HookUtils::parseRevisionParsoidHtml), and VisualEditor also applies
the same transformation (mw.libs.ve.unwrapParsoidSections) before
opening the page for editing.

Bug: T327704
Change-Id: I9d8288e2740d816edb9cbc01d7e5642d52c610d3
(cherry picked from commit c9deff179f)
This commit is contained in:
Bartosz Dziewoński 2023-01-26 20:09:27 +01:00
parent 1f342306b4
commit ee1b8c113d

View file

@ -247,6 +247,8 @@ class ApiDiscussionToolsEdit extends ApiBase {
$container = DOMCompat::getBody( $doc );
CommentUtils::unwrapParsoidSections( $container );
$threadItemSet = $this->commentParser->parse( $container, $title->getTitleValue() );
if ( $commentId ) {