mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-12-21 12:23:41 +00:00
f1edc47050
Since92f5cfd8
we support "mw-notalk" to suppressing comment detection in pages or sections. Until now, it only worked when the comment timestamp was surrounded by a marked element. However, when a marked element was directly adjacent to a comment, it would sometimes become a part of the comment range. This can no longer happen now. Existing use cases for this were the {{outdent}} and {{tracked}} templates, which we handle specially since50ad5bb2
andddd391b6
. It's a bit ugly to hardcode specific templates like that, and this provides a better solution for the future. The added test case displays some other potential uses. Bug: T324132 Change-Id: I7ffd299ef5957b35da8d01f9a0ed5a7a9a78be83
29 lines
3.7 KiB
HTML
29 lines
3.7 KiB
HTML
<div class="mw-parser-output">
|
|
<h2><span class="mw-headline" id="No_talk_section">No talk section</span></h2>
|
|
<div class="mw-notalk">
|
|
<ul><li>Vote 1. <a href="/wiki/User:DTDummyUserAlice" title="User:DTDummyUserAlice">DTDummyUserAlice</a> (<a href="/wiki/User_talk:DTDummyUserAlice" title="User talk:DTDummyUserAlice">talk</a>) 13:30, 10 March 2022 (UTC)</li>
|
|
<li>Vote 2. <a href="/wiki/User:DTDummyUserBob" title="User:DTDummyUserBob">DTDummyUserBob</a> (<a href="/wiki/User_talk:DTDummyUserBob" title="User talk:DTDummyUserBob">talk</a>) 13:40, 10 March 2022 (UTC)</li>
|
|
<li>Vote 3. <a href="/wiki/User:DTDummyUserEve" title="User:DTDummyUserEve">DTDummyUserEve</a> (<a href="/wiki/User_talk:DTDummyUserEve" title="User talk:DTDummyUserEve">talk</a>) 13:50, 10 March 2022 (UTC)</li></ul>
|
|
</div>
|
|
<div class="mw-archivedtalk" style="background: lightblue; padding: 20px; border: 1px solid blue;">
|
|
<h2><span class="mw-headline" id="Archived_section">Archived section</span></h2>
|
|
<p>Comment 1. <a href="/wiki/User:DTDummyUserAlice" title="User:DTDummyUserAlice">DTDummyUserAlice</a> (<a href="/wiki/User_talk:DTDummyUserAlice" title="User talk:DTDummyUserAlice">talk</a>) 14:30, 10 March 2022 (UTC)
|
|
</p>
|
|
<dl><dd>Comment 2. <a href="/wiki/User:DTDummyUserBob" title="User:DTDummyUserBob">DTDummyUserBob</a> (<a href="/wiki/User_talk:DTDummyUserBob" title="User talk:DTDummyUserBob">talk</a>) 14:40, 10 March 2022 (UTC)
|
|
<dl><dd>Comment 3. <a href="/wiki/User:DTDummyUserEve" title="User:DTDummyUserEve">DTDummyUserEve</a> (<a href="/wiki/User_talk:DTDummyUserEve" title="User talk:DTDummyUserEve">talk</a>) 14:50, 10 March 2022 (UTC)</dd></dl></dd></dl>
|
|
</div>
|
|
<h2><span class="mw-headline" id="Normal_talk_section">Normal talk section</span></h2>
|
|
<p>Comment 4 <a href="/wiki/User:DTDummyUserAlice" title="User:DTDummyUserAlice">DTDummyUserAlice</a> (<a href="/wiki/User_talk:DTDummyUserAlice" title="User talk:DTDummyUserAlice">talk</a>) 15:30, 10 March 2022 (UTC)
|
|
</p>
|
|
<dl><dd>Comment 5. <a href="/wiki/User:DTDummyUserBob" title="User:DTDummyUserBob">DTDummyUserBob</a> (<a href="/wiki/User_talk:DTDummyUserBob" title="User talk:DTDummyUserBob">talk</a>) 15:40, 10 March 2022 (UTC)
|
|
<dl><dd>Comment 6. <a href="/wiki/User:DTDummyUserEve" title="User:DTDummyUserEve">DTDummyUserEve</a> (<a href="/wiki/User_talk:DTDummyUserEve" title="User talk:DTDummyUserEve">talk</a>) 15:50, 10 March 2022 (UTC)</dd></dl></dd></dl>
|
|
<h2><span class="mw-headline" id="Talk_section_with_notalk_fragments">Talk section with notalk fragments</span></h2>
|
|
<div class="mw-notalk" style="border: 1px solid black;">notalk before a comment (e.g. {{edit protected}})</div>
|
|
<p>Comment 7 <a href="/wiki/User:DTDummyUserAlice" title="User:DTDummyUserAlice">DTDummyUserAlice</a> (<a href="/wiki/User_talk:DTDummyUserAlice" title="User talk:DTDummyUserAlice">talk</a>) 16:30, 10 March 2022 (UTC)
|
|
</p>
|
|
<div class="mw-notalk" style="border: 1px solid black;">notalk after a comment (e.g. {{reflist-talk}})</div>
|
|
<dl><dd><span class="mw-notalk" style="border: 1px solid black;">notalk before a comment, inline</span> Comment 8. <a href="/wiki/User:DTDummyUserBob" title="User:DTDummyUserBob">DTDummyUserBob</a> (<a href="/wiki/User_talk:DTDummyUserBob" title="User talk:DTDummyUserBob">talk</a>) 16:40, 10 March 2022 (UTC) <span class="mw-notalk" style="border: 1px solid black;">notalk after a comment, inline</span></dd></dl>
|
|
<div class="mw-notalk" style="border: 1px solid black;">notalk between comments (e.g. {{outdent}})</div>
|
|
<dl><dd><dl><dd>Comment 9. <a href="/wiki/User:DTDummyUserEve" title="User:DTDummyUserEve">DTDummyUserEve</a> (<a href="/wiki/User_talk:DTDummyUserEve" title="User talk:DTDummyUserEve">talk</a>) 16:50, 10 March 2022 (UTC)</dd></dl></dd></dl>
|
|
</div>
|