mediawiki-extensions-Discus.../tests/cases/wrappers/wrappers-modified.html
Bartosz Dziewoński 6e37a172ae Fix detecting decorative comment frames with whitespace
As a result of 0fc71f60cd, "empty" text
nodes (containing only whitespace) at the end of the comment may be
inside the comment's range, and trying to ignore them caused the
ranges not to match and the frame not to be detected.

Now the code works whether they're inside the comment's range or not.

Add a test case for wrapped discussion comments with HTML comments and
with whitespace.

Bug: T250126
Bug: T268407
Change-Id: I2217ff5a635fd1c9c9e803f46795b1bfb3d17535
2021-01-04 20:31:33 +01:00

36 lines
3.9 KiB
HTML

<h2 id="paragraph">paragraph</h2>
<p>blah blah <b><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">talk</a></b> 23:19, 22 January 2020 (UTC)</p><dl><dd data-parsoid="{}">Reply to c|Matma Rex|2020-01-22T23:19:00.000Z|paragraph</dd></dl>
<h2 id="preformatted">preformatted</h2>
<pre>blah blah <b><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">talk</a></b> 23:19, 22 January 2020 (UTC)</pre><dl><dd data-parsoid="{}">Reply to c|Matma Rex|2020-01-22T23:19:00.000Z|preformatted</dd></dl>
<h2 id="div_with_one_comment">div with one comment</h2>
<div style="background: beige;">
blah blah <b><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">talk</a></b> 23:19, 22 January 2020 (UTC)
</div><dl><dd data-parsoid="{}">Reply to c|Matma Rex|2020-01-22T23:19:00.000Z|div_with_one_comment</dd></dl>
<h2 id="div_with_one_comment-htmlcomments">div with one comment, and some HTML comments</h2>
<div style="background: beige;">
<i>hello</i><br/>
<small>blah blah <b><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">talk</a></b> 23:19, 22 January 2020 (UTC)</small><!-- blah -->
</div><!-- blah --><dl><dd data-parsoid="{}">Reply to c|Matma Rex|2020-01-22T23:19:00.000Z|div_with_one_comment-htmlcomments</dd></dl>
<h2 id="table_with_one_comment">table with one comment</h2>
<table border="1"><tbody><tr><td>
blah blah <b><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">talk</a></b> 23:19, 22 January 2020 (UTC)
</td></tr></tbody></table><dl><dd data-parsoid="{}">Reply to c|Matma Rex|2020-01-22T23:19:00.000Z|table_with_one_comment</dd></dl>
<h2 id="div_with_multiple_comments">div with multiple comments</h2>
<div style="background: beige;">
blah blah <b><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">talk</a></b> 23:19, 22 January 2020 (UTC)
<dl><dd>blah blah <b><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">talk</a></b> 23:19, 22 January 2020 (UTC)<dl><dd data-parsoid="{}">Reply to c|Matma Rex|2020-01-22T23:19:00.000Z|Matma Rex|2020-01-22T23:19:00.000Z</dd></dl></dd><dd data-parsoid="{}">Reply to c|Matma Rex|2020-01-22T23:19:00.000Z|div_with_multiple_comments</dd></dl>
blah blah <b><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">talk</a></b> 23:19, 22 January 2020 (UTC)
<dl><dd data-parsoid="{}">Reply to c|Matma Rex|2020-01-22T23:19:00.000Z|div_with_multiple_comments|1</dd></dl></div>
<h2 id="table_with_multiple_comments">table with multiple comments</h2>
<table border="1"><tbody><tr><td>
blah blah <b><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">talk</a></b> 23:19, 22 January 2020 (UTC)
<dl><dd>blah blah <b><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">talk</a></b> 23:19, 22 January 2020 (UTC)<dl><dd data-parsoid="{}">Reply to c|Matma Rex|2020-01-22T23:19:00.000Z|Matma Rex|2020-01-22T23:19:00.000Z|1</dd></dl></dd><dd data-parsoid="{}">Reply to c|Matma Rex|2020-01-22T23:19:00.000Z|table_with_multiple_comments</dd></dl>
blah blah <b><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">talk</a></b> 23:19, 22 January 2020 (UTC)
<dl><dd data-parsoid="{}">Reply to c|Matma Rex|2020-01-22T23:19:00.000Z|table_with_multiple_comments|1</dd></dl></td></tr></tbody></table>