mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 16:34:21 +00:00
04cfffe323
We wrap a `<div>` tag around the `<h2>`, and move some elements there. The markup is inspired by and compatible with my proposal for T13555. The "ext-discussiontools-init-section" class is moved to the `<div>`. A small patch is needed in MobileFrontend to preserve the section collapsing functionality: I11bff21e81046898ca63f3f432797129fa70ad88. The following elements are now outside of `<h2>`: * Metadata bar * Subscribe button * Ellipsis menu (only shown on mobile) The following elements are sadly still inside of `<h2>`: * Subscribe links (only shown on desktop) * Section edit links from MediaWiki core Trying to move them mucks up the CSS too much. I hope we can resolve this later as a part of the work on T13555. Depends-On: I11bff21e81046898ca63f3f432797129fa70ad88 Bug: T314714 Change-Id: I0bbdcfa02c334858737855349d7a35746de1d8f2
51 lines
7.8 KiB
HTML
51 lines
7.8 KiB
HTML
<span data-mw-thread-id="h--2021-02-24T19:24:00.000Z"><span data-mw-comment-start="" id="h--2021-02-24T19:24:00.000Z"></span><span data-mw-comment-end="h--2021-02-24T19:24:00.000Z"></span></span><span data-mw-comment-start="" id="c-Matma_Rex-2021-02-24T19:24:00.000Z"></span><style data-mw-deduplicate="TemplateStyles:r3303">.mw-parser-output .color-purple{color:purple}</style><div class="color-purple">This page demonstrates some quirks of raw HTML generated in ParserOutput, which gets saved to the parser cache and which we operate on in the ParserAfterTidy hook. Most other test cases are using the final HTML returned by ParserOutput::getText(), which we operate on in the OutputPageBeforeHTML hook.</div>
|
|
<p>Note:
|
|
</p>
|
|
<ul><li>No "mw-parser-output" wrapper div</li>
|
|
<li>Funky mw:editsection tags</li></ul>
|
|
<p><a href="/wiki/User:Matma_Rex" title="User:Matma Rex">Matma Rex</a> (<a href="/wiki/User_talk:Matma_Rex" title="User talk:Matma Rex"><font color="green"><i>talk</i></font></a>) 19:24, 24 February 2021 (UTC)<span class="ext-discussiontools-init-replylink-buttons" data-mw-thread-id="c-Matma_Rex-2021-02-24T19:24:00.000Z"><span class="ext-discussiontools-init-replybutton oo-ui-widget oo-ui-widget-enabled oo-ui-buttonElement oo-ui-buttonElement-frameless oo-ui-labelElement oo-ui-flaggedElement-progressive oo-ui-buttonWidget" data-ooui='{"_":"OO.ui.ButtonWidget","rel":["nofollow"],"framed":false,"label":"(discussiontools-replybutton)","flags":["progressive"],"classes":["ext-discussiontools-init-replybutton"]}'><a role="button" tabindex="0" rel="nofollow" class="oo-ui-buttonElement-button"><span class="oo-ui-iconElement-icon oo-ui-iconElement-noIcon oo-ui-image-progressive"></span><span class="oo-ui-labelElement-label">(discussiontools-replybutton)</span><span class="oo-ui-indicatorElement-indicator oo-ui-indicatorElement-noIndicator oo-ui-image-progressive"></span></a></span><span class="ext-discussiontools-init-replylink-bracket">[</span><a class="ext-discussiontools-init-replylink-reply" role="button" tabindex="0" href="">(discussiontools-replylink)</a><span class="ext-discussiontools-init-replylink-bracket">]</span></span><span data-mw-comment-end="c-Matma_Rex-2021-02-24T19:24:00.000Z"></span>
|
|
</p>
|
|
<div class="mw-heading mw-heading2 ext-discussiontools-init-section"><span class='ext-discussiontools-init-section-subscribeButton oo-ui-widget oo-ui-widget-enabled oo-ui-buttonElement oo-ui-buttonElement-frameless oo-ui-iconElement oo-ui-labelElement oo-ui-flaggedElement-progressive oo-ui-buttonWidget' data-ooui='{"_":"OO.ui.ButtonWidget","rel":["nofollow"],"framed":false,"icon":"bellOutline","label":"(discussiontools-topicsubscription-button-subscribe-label)","title":"(discussiontools-topicsubscription-button-subscribe-tooltip)","flags":["progressive"],"classes":["ext-discussiontools-init-section-subscribeButton"]}'><a role='button' title='(discussiontools-topicsubscription-button-subscribe-tooltip)' tabindex='0' rel='nofollow' class='oo-ui-buttonElement-button'><span class='oo-ui-iconElement-icon oo-ui-icon-bellOutline oo-ui-image-progressive'></span><span class='oo-ui-labelElement-label'>(discussiontools-topicsubscription-button-subscribe-label)</span><span class='oo-ui-indicatorElement-indicator oo-ui-indicatorElement-noIndicator oo-ui-image-progressive'></span></a></span><h2><span class="ext-discussiontools-init-section-subscribe mw-editsection-like"><span class="ext-discussiontools-init-section-subscribe-bracket">[</span><a href="" class="ext-discussiontools-init-section-subscribe-link" role="button" tabindex="0" title="(discussiontools-topicsubscription-button-subscribe-tooltip)">(discussiontools-topicsubscription-button-subscribe)</a><span class="ext-discussiontools-init-section-subscribe-bracket">]</span></span><span id="Heading_with_a_.22_quote"></span><span class="mw-headline" id="Heading_with_a_"_quote" data-mw-thread-id="h-Heading_with_a_"_quote-2021-02-24T19:24:00.000Z"><span data-mw-comment-start="" id="h-Heading_with_a_"_quote-2021-02-24T19:24:00.000Z"></span>Heading with a " quote<span data-mw-comment-end="h-Heading_with_a_"_quote-2021-02-24T19:24:00.000Z"></span></span><mw:editsection page="Talk:For parser cache" section="1">Heading with a " quote</mw:editsection></h2><div class="ext-discussiontools-init-section-bar"><div class="ext-discussiontools-init-section-metadata"><span class='ext-discussiontools-init-section-metaitem ext-discussiontools-init-section-timestampLabel'>(discussiontools-topicheader-latestcomment: <a href="#c-Matma_Rex-2021-02-24T19:24:00.000Z-Heading_with_a_"_quote">1614194640</a>)</span><span class='ext-discussiontools-init-section-metaitem ext-discussiontools-init-section-commentCountLabel'>(discussiontools-topicheader-commentcount: 1)</span><span class='ext-discussiontools-init-section-metaitem ext-discussiontools-init-section-authorCountLabel'>(discussiontools-topicheader-authorcount: 1)</span></div><div class="ext-discussiontools-init-section-actions"></div></div></div>
|
|
<p><span data-mw-comment-start="" id="c-Matma_Rex-2021-02-24T19:24:00.000Z-Heading_with_a_"_quote"></span>Test. <a href="/wiki/User:Matma_Rex" title="User:Matma Rex">Matma Rex</a> (<a href="/wiki/User_talk:Matma_Rex" title="User talk:Matma Rex"><font color="green"><i>talk</i></font></a>) 19:24, 24 February 2021 (UTC)<span class="ext-discussiontools-init-replylink-buttons" data-mw-thread-id="c-Matma_Rex-2021-02-24T19:24:00.000Z-Heading_with_a_"_quote"><span class="ext-discussiontools-init-replybutton oo-ui-widget oo-ui-widget-enabled oo-ui-buttonElement oo-ui-buttonElement-frameless oo-ui-labelElement oo-ui-flaggedElement-progressive oo-ui-buttonWidget" data-ooui='{"_":"OO.ui.ButtonWidget","rel":["nofollow"],"framed":false,"label":"(discussiontools-replybutton)","flags":["progressive"],"classes":["ext-discussiontools-init-replybutton"]}'><a role="button" tabindex="0" rel="nofollow" class="oo-ui-buttonElement-button"><span class="oo-ui-iconElement-icon oo-ui-iconElement-noIcon oo-ui-image-progressive"></span><span class="oo-ui-labelElement-label">(discussiontools-replybutton)</span><span class="oo-ui-indicatorElement-indicator oo-ui-indicatorElement-noIndicator oo-ui-image-progressive"></span></a></span><span class="ext-discussiontools-init-replylink-bracket">[</span><a class="ext-discussiontools-init-replylink-reply" role="button" tabindex="0" href="">(discussiontools-replylink)</a><span class="ext-discussiontools-init-replylink-bracket">]</span></span><span data-mw-comment-end="c-Matma_Rex-2021-02-24T19:24:00.000Z-Heading_with_a_"_quote"></span>
|
|
</p>
|
|
<!--__DTLATESTCOMMENTPAGE__{"id":"c-Matma_Rex-2021-02-24T19:24:00.000Z-Heading_with_a_\"_quote","timestamp":"2021-02-24T19:24:00.000Z","author":"Matma Rex","heading":{"headingLevel":2,"name":"h-Matma_Rex-2021-02-24T19:24:00.000Z","type":"heading","level":0,"id":"h-Heading_with_a_\"_quote-2021-02-24T19:24:00.000Z","replies":["c-Matma_Rex-2021-02-24T19:24:00.000Z-Heading_with_a_\"_quote"],"text":"Heading with a \" quote","linkableTitle":"Heading with a \" quote"}}__--><!--__DTHASLEDECONTENT__-->
|
|
<pre>
|
|
{
|
|
"wgDiscussionToolsPageThreads": [
|
|
{
|
|
"headingLevel": null,
|
|
"name": "h-Matma_Rex-2021-02-24T19:24:00.000Z",
|
|
"type": "heading",
|
|
"level": 0,
|
|
"id": "h--2021-02-24T19:24:00.000Z",
|
|
"replies": [
|
|
{
|
|
"timestamp": "2021-02-24T19:24:00.000Z",
|
|
"author": "Matma Rex",
|
|
"type": "comment",
|
|
"level": 1,
|
|
"id": "c-Matma_Rex-2021-02-24T19:24:00.000Z",
|
|
"replies": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"headingLevel": 2,
|
|
"name": "h-Matma_Rex-2021-02-24T19:24:00.000Z",
|
|
"type": "heading",
|
|
"level": 0,
|
|
"id": "h-Heading_with_a_\"_quote-2021-02-24T19:24:00.000Z",
|
|
"replies": [
|
|
{
|
|
"timestamp": "2021-02-24T19:24:00.000Z",
|
|
"author": "Matma Rex",
|
|
"type": "comment",
|
|
"level": 1,
|
|
"id": "c-Matma_Rex-2021-02-24T19:24:00.000Z-Heading_with_a_\"_quote",
|
|
"replies": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
</pre> |