mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Poem
synced 2024-11-15 10:59:33 +00:00
Sync up with Parsoid poemParserTests.txt
This now aligns with Parsoid commit b4f56a9d2786d9cb98bdc352a72597c5d8d4f849 Change-Id: Ib5d77a2038fcab9b4751291507f429c013eed2aa
This commit is contained in:
parent
e113e34041
commit
f8efe714c7
|
@ -3,6 +3,12 @@
|
|||
poem
|
||||
!! endhooks
|
||||
|
||||
!! article
|
||||
Template:1x
|
||||
!! text
|
||||
{{{1}}}
|
||||
!! endarticle
|
||||
|
||||
#Regression tests for existing functionality, to ensure nothing was broken.
|
||||
!! test
|
||||
<poem>
|
||||
|
@ -21,10 +27,15 @@ a<br />
|
|||
test
|
||||
</p>
|
||||
</div>
|
||||
!! html/parsoid
|
||||
<div class="poem" typeof="mw:Extension/poem" about="#mwt3" data-mw='{"name":"poem","attrs":{},"body":{"extsrc":"\nthis\nis\na\ntest\n"}}'><p>this<br/>
|
||||
is<br/>
|
||||
a<br/>
|
||||
test</p></div>
|
||||
!! end
|
||||
|
||||
!!test
|
||||
<poem> with recursive parsing
|
||||
<poem> with recursive parsing
|
||||
!!wikitext
|
||||
<poem>
|
||||
this ''is'' a '''test'''
|
||||
|
@ -34,11 +45,13 @@ this ''is'' a '''test'''
|
|||
<p>this <i>is</i> a <b>test</b>
|
||||
</p>
|
||||
</div>
|
||||
!! html/parsoid
|
||||
<div class="poem" typeof="mw:Extension/poem" about="#mwt3" data-mw='{"name":"poem","attrs":{},"body":{"extsrc":"\nthis ''is'' a '''test'''\n"}}'><p>this <i>is</i> a <b>test</b></p></div>
|
||||
!!end
|
||||
|
||||
|
||||
## FIXME: Is Parsoid output the right output wrt how it actually renders?
|
||||
!!test
|
||||
<poem> with leading whitespace
|
||||
<poem> with leading whitespace
|
||||
!!wikitext
|
||||
<poem>
|
||||
|
||||
|
@ -51,8 +64,13 @@ this ''is'' a '''test'''
|
|||
   test<br />
|
||||
</p>
|
||||
</div>
|
||||
!! html/parsoid
|
||||
<div class="poem" typeof="mw:Extension/poem" about="#mwt3" data-mw='{"name":"poem","attrs":{},"body":{"extsrc":"\n\n test\n\n"}}'><p><br/>
|
||||
<span typeof="mw:Entity"> </span> test<br/></p>
|
||||
</div>
|
||||
!!end
|
||||
|
||||
## FIXME: Parsoid adds <p> wrapper around the THML <br/> tag
|
||||
!!test
|
||||
Horizontal rule
|
||||
!!wikitext
|
||||
|
@ -69,32 +87,14 @@ text
|
|||
<p>text
|
||||
</p>
|
||||
</div>
|
||||
!! html/parsoid
|
||||
<div class="poem" typeof="mw:Extension/poem" about="#mwt3" data-mw='{"name":"poem","attrs":{},"body":{"extsrc":"\nsome\n-----\ntext\n"}}'><p>some<br/></p>
|
||||
<hr/>
|
||||
<p>text</p></div>
|
||||
!!end
|
||||
|
||||
#test for new poem/nowiki feature; should fail without new enhancement.
|
||||
!! test 2
|
||||
example of <nowiki> without <poem>
|
||||
!!options
|
||||
disabled
|
||||
!! wikitext
|
||||
<nowiki>
|
||||
this
|
||||
is
|
||||
a
|
||||
test
|
||||
</nowiki>
|
||||
!! html/php+tidy
|
||||
<p>
|
||||
this
|
||||
is
|
||||
a
|
||||
test
|
||||
|
||||
</p>
|
||||
!! end
|
||||
|
||||
!! test
|
||||
nested <poem><nowiki>
|
||||
nested <poem><nowiki>
|
||||
!! wikitext
|
||||
<poem><nowiki>
|
||||
this
|
||||
|
@ -112,10 +112,17 @@ test<br />
|
|||
|
||||
</p>
|
||||
</div>
|
||||
!! html/parsoid
|
||||
<div class="poem" typeof="mw:Extension/poem" about="#mwt4" data-mw='{"name":"poem","attrs":{},"body":{"extsrc":"<nowiki>\nthis\nis\na\ntest\n</nowiki>"}}'><p><br/>
|
||||
this<br/>
|
||||
is<br/>
|
||||
a<br/>
|
||||
test<br/>
|
||||
</p></div>
|
||||
!!end
|
||||
|
||||
!! test 5
|
||||
nested <poem><nowiki> with formatting
|
||||
!! test
|
||||
nested <poem><nowiki> with formatting
|
||||
!! wikitext
|
||||
<poem><nowiki>
|
||||
this
|
||||
|
@ -133,6 +140,13 @@ test<br />
|
|||
|
||||
</p>
|
||||
</div>
|
||||
!! html/parsoid
|
||||
<div class="poem" typeof="mw:Extension/poem" about="#mwt4" data-mw='{"name":"poem","attrs":{},"body":{"extsrc":"<nowiki>\nthis\n'''is'''\na\ntest\n</nowiki>"}}'><p><br/>
|
||||
this<br/>
|
||||
'''is'''<br/>
|
||||
a<br/>
|
||||
test<br/>
|
||||
</p></div>
|
||||
!! end
|
||||
|
||||
!! test
|
||||
|
@ -152,4 +166,100 @@ Through caverns measureless to man<br />
|
|||
Down to a sunless sea.
|
||||
</p>
|
||||
</div>
|
||||
!! html/parsoid
|
||||
<div class="poem" style="border: 2px solid #d6d2c5; background-color: #f9f4e6; padding: 1em;" typeof="mw:Extension/poem" about="#mwt3" data-mw='{"name":"poem","attrs":{"style":"border: 2px solid #d6d2c5; background-color: #f9f4e6; padding: 1em;"},"body":{"extsrc":"\nA stately pleasure-dome decree:\nWhere Alph, the sacred river, ran\nThrough caverns measureless to man\nDown to a sunless sea.\n"}}'><p>A stately pleasure-dome decree:<br/>
|
||||
Where Alph, the sacred river, ran<br/>
|
||||
Through caverns measureless to man<br/>
|
||||
Down to a sunless sea.</p></div>
|
||||
!! end
|
||||
|
||||
# FIXME: This test should be removed once we stop span-wrapping entities in nowikis
|
||||
!! test
|
||||
Verify Parsoid handles entities in nowikis in poem correctly
|
||||
!! wikitext
|
||||
<poem>
|
||||
L1
|
||||
L2
|
||||
<nowiki>
|
||||
<ref>Not a ref</ref>
|
||||
foo & bar
|
||||
[[Not a link]]
|
||||
</nowiki>
|
||||
L3
|
||||
</poem>
|
||||
!! html/parsoid
|
||||
<div class="poem" typeof="mw:Extension/poem" about="#mwt4" data-parsoid='{"dsr":[0,92,2,2]}' data-mw='{"name":"poem","attrs":{},"body":{"extsrc":"\nL1\nL2\n<nowiki>\n<ref>Not a ref</ref>\nfoo &amp; bar\n[[Not a link]]\n</nowiki>\nL3\n"}}'><p>L1<br/>
|
||||
L2<br/>
|
||||
<br/>
|
||||
<ref>Not a ref</ref><br/>
|
||||
foo <span typeof="mw:Entity">&</span> bar<br/>
|
||||
[[Not a link]]<br/>
|
||||
<br/>
|
||||
L3</p></div>
|
||||
!! end
|
||||
|
||||
!! test
|
||||
UTF-8 sequences in extension tags (T231945)
|
||||
!! wikitext
|
||||
<poem>
|
||||
{{1x|ၶိူဝ်းႁဝ်ၶိူဝ်းရႃႇၸႃႇ}}
|
||||
</poem>
|
||||
!! html/php+tidy
|
||||
<div class="poem">
|
||||
<p>ၶိူဝ်းႁဝ်ၶိူဝ်းရႃႇၸႃႇ
|
||||
</p>
|
||||
</div>
|
||||
!! html/parsoid
|
||||
<div class="poem" typeof="mw:Extension/poem" about="#mwt4" data-mw='{"name":"poem","attrs":{},"body":{"extsrc":"\n{{1x|ၶိူဝ်းႁဝ်ၶိူဝ်းရႃႇၸႃႇ}}\n"}}'><p about="#mwt2" typeof="mw:Transclusion" data-parsoid='{"pi":[[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"1x","href":"./Template:1x"},"params":{"1":{"wt":"ၶိူဝ်းႁဝ်ၶိူဝ်းရႃႇၸႃႇ"}},"i":0}}]}'>ၶိူဝ်းႁဝ်ၶိူဝ်းရႃႇၸႃႇ</p></div>
|
||||
!! end
|
||||
|
||||
!! test
|
||||
Multi-line poems with indentation use spans and breaks correctly (T235709)
|
||||
!! wikitext
|
||||
<poem>
|
||||
''CONGREGATI''
|
||||
:'''EX TOTO ORBE'''
|
||||
::'''''MATHEMATICI'''''
|
||||
</poem>
|
||||
!! html/parsoid
|
||||
<div class="poem" typeof="mw:Extension/poem" about="#mwt3" data-mw="{"name":"poem","attrs":{},"body":{"extsrc":"\n''CONGREGATI''\n:'''EX TOTO ORBE'''\n::'''''MATHEMATICI'''''\n"}}"><p data-parsoid="{}"><i data-parsoid="{}">CONGREGATI</i><br data-parsoid='{"stx":"html","selfClose":true}'/>
|
||||
<span class="mw-poem-indented" style="display: inline-block; margin-left: 1em;" data-parsoid='{"stx":"html"}'><b data-parsoid="{}">EX TOTO ORBE</b></span><br data-parsoid='{"stx":"html","selfClose":true}'/>
|
||||
<span class="mw-poem-indented" style="display: inline-block; margin-left: 2em;" data-parsoid='{"stx":"html"}'><i data-parsoid="{}"><b data-parsoid="{}">MATHEMATICI</b></i></span></p></div>
|
||||
!!html/php+tidy
|
||||
<div class="poem">
|
||||
<p><i>CONGREGATI</i><br />
|
||||
<span class="mw-poem-indented" style="display: inline-block; margin-left: 1em;"><b>EX TOTO ORBE</b></span><br />
|
||||
<span class="mw-poem-indented" style="display: inline-block; margin-left: 2em;"><i><b>MATHEMATICI</b></i></span>
|
||||
</p>
|
||||
</div>
|
||||
!! end
|
||||
|
||||
!! test
|
||||
Poem with class
|
||||
!! wikitext
|
||||
<poem class="hiho">
|
||||
hi ho
|
||||
</poem>
|
||||
!! html/php+tidy
|
||||
<div class="poem hiho">
|
||||
<p>hi ho
|
||||
</p>
|
||||
</div>
|
||||
!! html/parsoid
|
||||
<div class="poem hiho" typeof="mw:Extension/poem" about="#mwt3" data-mw='{"name":"poem","attrs":{"class":"hiho"},"body":{"extsrc":"\nhi ho\n"}}'><p>hi ho</p></div>
|
||||
!! end
|
||||
|
||||
!! test
|
||||
Poem with empty class
|
||||
!! wikitext
|
||||
<poem class="">
|
||||
hi ho
|
||||
</poem>
|
||||
!! html/php+tidy
|
||||
<div class="poem">
|
||||
<p>hi ho
|
||||
</p>
|
||||
</div>
|
||||
!! html/parsoid
|
||||
<div class="poem" typeof="mw:Extension/poem" about="#mwt3" data-mw='{"name":"poem","attrs":{"class":""},"body":{"extsrc":"\nhi ho\n"}}'><p>hi ho</p></div>
|
||||
!! end
|
||||
|
|
Loading…
Reference in a new issue