「使用者:丁志仁」修訂間的差異
行 6: | 行 6: | ||
==Poem 標籤== | ==Poem 標籤== | ||
<poem> | <poem> | ||
− | + | !! Version 2 | |
− | + | # Force the test runner to ensure the extension is loaded | |
− | + | !! hooks | |
− | + | poem | |
+ | !! endhooks | ||
+ | |||
+ | !! article | ||
+ | Template:1x | ||
+ | !! text | ||
+ | {{{1}}} | ||
+ | !! endarticle | ||
+ | |||
+ | #Regression tests for existing functionality, to ensure nothing was broken. | ||
+ | !! test | ||
+ | <poem> | ||
+ | !! wikitext | ||
+ | <poem> | ||
+ | this | ||
+ | is | ||
+ | a | ||
+ | test | ||
+ | </poem> | ||
+ | !! html/php | ||
+ | <div class="poem"> | ||
+ | <p>this<br /> | ||
+ | is<br /> | ||
+ | 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 | ||
+ | !!wikitext | ||
+ | <poem> | ||
+ | this ''is'' a '''test''' | ||
+ | </poem> | ||
+ | !! html/php | ||
+ | <div class="poem"> | ||
+ | <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 | ||
+ | !!wikitext | ||
+ | <poem> | ||
+ | |||
+ | test | ||
+ | |||
+ | </poem> | ||
+ | !! html/php | ||
+ | <div class="poem"> | ||
+ | <p><br /> | ||
+ |    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 | ||
+ | <poem> | ||
+ | some | ||
+ | ----- | ||
+ | text | ||
+ | </poem> | ||
+ | !! html/php | ||
+ | <div class="poem"> | ||
+ | <p>some<br /> | ||
+ | </p> | ||
+ | <hr /> | ||
+ | <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 | ||
+ | nested <poem><nowiki> | ||
+ | !! wikitext | ||
+ | <poem><nowiki> | ||
+ | this | ||
+ | is | ||
+ | a | ||
+ | test | ||
+ | </nowiki></poem> | ||
+ | !! html/php | ||
+ | <div class="poem"> | ||
+ | <p><br /> | ||
+ | this<br /> | ||
+ | is<br /> | ||
+ | a<br /> | ||
+ | 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 | ||
+ | nested <poem><nowiki> with formatting | ||
+ | !! wikitext | ||
+ | <poem><nowiki> | ||
+ | this | ||
+ | '''is''' | ||
+ | a | ||
+ | test | ||
+ | </nowiki></poem> | ||
+ | !! html/php | ||
+ | <div class="poem"> | ||
+ | <p><br /> | ||
+ | this<br /> | ||
+ | '''is'''<br /> | ||
+ | a<br /> | ||
+ | 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 | ||
+ | Basic <poem> usage with style | ||
+ | !! wikitext | ||
+ | <poem style="border: 2px solid #d6d2c5; background-color: #f9f4e6; padding: 1em;"> | ||
+ | A stately pleasure-dome decree: | ||
+ | Where Alph, the sacred river, ran | ||
+ | Through caverns measureless to man | ||
+ | Down to a sunless sea. | ||
+ | </poem> | ||
+ | !! html/php | ||
+ | <div style="border: 2px solid #d6d2c5; background-color: #f9f4e6; padding: 1em;" class="poem"> | ||
+ | <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> | ||
+ | !! 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/php | ||
+ | <div class="poem"> | ||
+ | <p>L1<br /> | ||
+ | L2<br /> | ||
+ | <br /> | ||
+ | <ref>Not a ref</ref><br /> | ||
+ | foo & bar<br /> | ||
+ | [[Not a link]]<br /> | ||
+ | <br /> | ||
+ | L3 | ||
+ | </p> | ||
+ | </div> | ||
+ | !! 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 | ||
+ | <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/php | ||
+ | <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> | ||
+ | !! 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> | ||
+ | !! end | ||
+ | |||
+ | !! test | ||
+ | Poem with class | ||
+ | !! wikitext | ||
+ | <poem class="hiho"> | ||
+ | hi ho | ||
+ | </poem> | ||
+ | !! html/php | ||
+ | <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 | ||
+ | <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 | ||
</poem> | </poem> | ||
於 2025年6月29日 (日) 14:58 的修訂
Poem 標籤
<poem> !! Version 2
- Force the test runner to ensure the extension is loaded
!! hooks poem !! endhooks
!! article Template:1x !! text {{{1}}} !! endarticle
- Regression tests for existing functionality, to ensure nothing was broken.
!! test <poem> !! wikitext <poem> this is a test </poem> !! html/php
this
is
a
test
!! html/parsoid
this
is
a
!! end
!!test <poem> with recursive parsing !!wikitext <poem> this is a test </poem> !! html/php
this is a test
!! html/parsoid
this is a test
!!end
- FIXME: Is Parsoid output the right output wrt how it actually renders?
!!test <poem> with leading whitespace !!wikitext <poem>
test
</poem> !! html/php
test
!! html/parsoid
test
!!end
- FIXME: Parsoid adds
wrapper around the THML
tag
- FIXME: Parsoid adds
!!test Horizontal rule !!wikitext <poem> some
text </poem> !! html/php
some
text
!! html/parsoid
some
text
!!end
!! test nested <poem> !! wikitext <poem><nowiki> this is a test </poem> !! html/php
this
is
a
test
!! html/parsoid
this
is
a
test
!!end
!! test nested <poem> with formatting !! wikitext <poem><nowiki> this '''is''' a test </poem> !! html/php
this
is
a
test
!! html/parsoid
this
is
a
test
!! end
!! test Basic <poem> usage with style !! wikitext <poem style="border: 2px solid #d6d2c5; background-color: #f9f4e6; padding: 1em;"> A stately pleasure-dome decree: Where Alph, the sacred river, ran Through caverns measureless to man Down to a sunless sea. </poem> !! html/php
A stately pleasure-dome decree:
Where Alph, the sacred river, ran
Through caverns measureless to man
Down to a sunless sea.
!! html/parsoid
A stately pleasure-dome decree:
Where Alph, the sacred river, ran
Through caverns measureless to man
!! 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 <ref>Not a ref</ref> foo & bar [[Not a link]] L3 </poem> !! html/php
L1
L2
<ref>Not a ref</ref>
foo & bar
Not a link
L3
!! html/parsoid
L1
L2
<ref>Not a ref</ref>
foo & bar
Not a link
!! end
!! test UTF-8 sequences in extension tags (T231945) !! wikitext <poem> 模板:1x </poem> !! html/php
ၶိူဝ်းႁဝ်ၶိူဝ်းရႃႇၸႃႇ
!! html/parsoid
ၶိူဝ်းႁဝ်ၶိူဝ်းရႃႇၸႃႇ
!! end
!! test Multi-line poems with indentation use spans and breaks correctly (T235709) !! wikitext <poem> CONGREGATI
- EX TOTO ORBE
- MATHEMATICI
</poem> !! html/php
CONGREGATI
EX TOTO ORBE
MATHEMATICI
!! html/parsoid
CONGREGATI
EX TOTO ORBE
!! end
!! test Poem with class !! wikitext <poem class="hiho"> hi ho </poem> !! html/php
hi ho
!! html/parsoid
hi ho
!! end
!! test Poem with empty class !! wikitext <poem class=""> hi ho </poem> !! html/php
hi ho
!! html/parsoid
hi ho
!! end </poem>
Details 標籤
收納
- 直接改 mediawiki 接受 details 標籤
- 直接改 mediawiki 接受 summary 標籤
- 參考解除HTML標籤使用限制
通訊錄
單一 wiki 頁使用 CSS 的示範,請看本頁原始碼頁首 {{#css:…}}與下表
姓名 | line | 備註 | |
---|---|---|---|
丁志仁 | 丁志仁 | aledu2@gmail.com | 老師 |
李昀蓁 | 昀蓁 Alika 星 | alikayuen921@gmail.com | Etudiante |
徐恕禾 | 素梅 | i61021221@gmail.com | Etudiante |
黃稚博 | 自拔 | burtfook@gmail.com | Etudiante |
鄭云禎 | yun | lola20040427@gmail.com | Etudiante |
徐慕禾 | 徐慕禾 | momo020219@gmail.com | Etudiante |
數學符號測試
- [math]E=mc^2[/math]
- [math]\begin{align}
\dot{x} & = \sigma(y-x) \\
\dot{y} & = \rho x - y - xz \\
\dot{z} & = -\beta z + xy
\end{align}[/math]
- [math]\mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix}
\mathbf{i} & \mathbf{j} & \mathbf{k} \\
\frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\
\frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0
\end{vmatrix}[/math]
- [math]1 + \frac{q^2}{(1-q)} + \frac{q^6}{(1-q)(1-q^2)} + \cdots = \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})}, \quad\quad for\,|q|\lt 1.[/math]