!! Version 2 !! article Template:1x !! text {{{1}}} !! endarticle # TODO: add a test for T295168 when tackling it !! test Continue to serialize the old annotated 2.3.0 html !! options parsoid=html2wt annotations=1 !! html/parsoid

foo

foo

bar

baz

foo

bar

baz

!! wikitext foo foo bar baz foo bar baz !! end !! test Whole content between dummyanno tags !! options annotations=1 !! wikitext ==Title== Let's have some text. !! html/parsoid

Title

Let's have some text.

!! end !! test Inline dummyanno tags !! options annotations=1 !! wikitext Some text with some annotated content inline. !! html/parsoid

Some text with some annotated content inline.

!! end !! test Template inside a dummyanno tag should not make a difference on its handling !! options annotations=1 !! wikitext {{1x| == Title == }} Let's have some text. !! html/parsoid

Title

Let's have some text.

!! end !! test Two inline dummyanno tags should have different rangeIds !! options annotations=1 !! wikitext Some inline text followed by some more text inline !! html/parsoid

Some inline text followed by some more text inline

!! end !! test Two dummyanno tags on new lines should have different rangeIds !! options annotations=1 !! wikitext Some text followed by some more text to dummyanno !! html/parsoid

Some text followed by some more text to dummyanno

!! end !! test Name attribute in ann2 tags should be added to the meta tag !! options annotations=1 !! wikitext Some text with some undummyannod content inline. !! html/parsoid

Some text with some undummyannod content inline.

!! end !! test Annotation wrapping an entire paragraph should be nested inside the paragraph !! options annotations=1 !! wikitext foo bar baz !! html/parsoid

foo

bar

baz

!! end !! test Two paragraphs between dummyanno tags should roundtrip without duplicating the tags (DSRs are adjusted correctly) !! options annotations=1 !! wikitext plop Let's have some text. !! html/parsoid

plop

Let's have some text.

!! end !! test Start dummyanno tag at the beginning of a paragraph and end within should extend to the end of but not the whole paragraph !! options parsoid={ "modes": ["wt2html", "selser","wt2wt"] } annotations=1 !! wikitext This should ''fail miserably'' ... let's fix it !! html/parsoid here

This should fail miserably ... let's fix it

!! end !! test End dummyanno tag at the end of a paragraph and beginning within should extend to the end of but not the whole paragraph !! options parsoid={ "modes": ["wt2html", "selser","wt2wt"] } annotations=1 !! wikitext This should ''fail miserably'' ... let's fix it !! html/parsoid here

This should fail miserably ... let's fix it

!! end !! test Meta merging with annotations/template should not happen !! options annotations=1 !! wikitext {{1x|stuff}} !! html/parsoid

stuff

!! end !! test Meta merging with template/annotation is fine !! options annotations=1 !! wikitext {{1x|stuff}} !! html/parsoid

stuff

!! end !! test Attributes without value should be transferred to and back from the meta tag !! options annotations=1 !! wikitext some stuff !! html/parsoid

some stuff

!! end !! test Annotation open tag in fosterable position should expand the range to the entire table !! options parsoid={ "modes": ["wt2html", "selser","wt2wt"] } annotations=1 !! wikitext {| |table |with |- |some |content |- |dummyanno |one line |} !! html/parsoid
table with
some content
dummyanno one line
!! end !! test dummyanno in the middle of fostered content should extend to the whole range, including fostered content !! options parsoid={ "modes": ["wt2html", "selser","wt2wt"] } annotations=1 !! wikitext {| foo bar |- |baz |} !! html/parsoid

foo bar

baz
!!end !!test dummyanno getting roped into a template because of fostering should get the about attribute of the template !! options parsoid={ "modes": ["wt2html", "selser","wt2wt"] } annotations=1 !! wikitext {{1x|Some text! }}
table
stuff
!! html/parsoid

Some text!

table
stuff
!!end !! test dummyanno tags around
 area with new lines
!! options
annotations=1
!! wikitext

 foo

!! html/parsoid

foo
!! end !! test Newlines should be inserted between annotation tags and pre !! options parsoid={ "modes": ["html2wt"] } annotations=1 !! html/parsoid foo
bar
baz foo
bar
baz !! wikitext foo bar baz foo bar baz !! end !! test dummyanno tags in list items !! options annotations=1 !! wikitext *List item! !! html/parsoid
  • List item!
!! end ### Tests from annotation spec !! test 1/ Whole content contained in annotation tags !! options annotations=1 !! wikitext One paragraph. And another. !! html/parsoid

One paragraph.

And another.

!! end !! test 2/ Extended annotation range !! options parsoid={ "modes": ["wt2html", "selser","wt2wt"] } annotations=1 !! wikitext This is ''an artificial'' '''example of''' extension. !! html/parsoid

This is an artificial example of extension.

!! end !! test 3/ Two types of annotation, nested; annotation attributes !! options annotations=1 !! wikitext Some text with a variable in the middle !! html/parsoid

Some text with a variable in the middle

!! end !! test 4/ Template (fully enclosed) in annotation range !! options annotations=1 !! wikitext aa bb {{1x|some content}} bb aa !! html/parsoid

aa bb some content bb aa

!! end !! test 5/ annotation (fully enclosed) in template !! options annotations=1 !! wikitext {{1x|bb some content bb}} aa !! html/parsoid

bb some content bb aa

!! end !! test 7/ attributes in annotations !! options annotations=1 !! wikitext {| |- | style="background: red; color: white;" |abc |jkl |} !! html/parsoid
abc jkl
!! end !! test 8/ fostered annotation markers !! options parsoid={ "modes": ["wt2html", "selser", "wt2wt"] } annotations=1 !! wikitext {| |table |with |- |some |content |- |dummyanno |one line |} !! html/parsoid
table with
some content
dummyanno one line
!!end !! test Selser: add a paragraph at the end of the content should not make the tag disappear !! options parsoid={ "modes": ["selser"], "changes": [ ["p", "after", "

plop

"] ] } annotations=1 !! wikitext ==plop== Add another paragraph. !! wikitext/edited ==plop== Add another paragraph. plop !!end !! test Selser: add content at the end of a paragraph with badly nested content with annotation !! options parsoid={ "modes": ["selser"], "changes": [ ["p", "append", "something"] ] } annotations=1 !! wikitext Some ''stuff and '''also some'' more stuff''' than that. !! wikitext/edited Some ''stuff and '''also some'' more stuff''' than that.something !! end !! test Selser: add content at the end of a paragraph with badly nested content without annotation !! options annotations=1 !! wikitext Some ''stuff and '''also some'' more stuff''' than that. !! html/parsoid

Some stuff and also some more stuff than that.

!! end !! test Selser: add content in a cell of a table where dummyanno gets fostered out should keep the annotation around the table !! options parsoid={ "modes": ["selser"], "changes": [ ["tr > td:first-child", "text", "plop"] ] } annotations=1 !! wikitext {| |- |a |b |- |c |d |- |e |f |} !!wikitext/edited {| |- |plop |b |- |plop |d |- |plop |f |} !!end !! test Selser: add content before and after and tags should keep paragraphs !! options parsoid={ "modes": ["selser"], "changes": [ ["meta", "before", "

plop

"], ["meta", "after", "

plop2

"] ] } annotations=1 !! wikitext hello !! wikitext/edited plop plop2 hello plop plop2 !! end !! test Selser: add content before and tags should keep paragraphs !! options parsoid={ "modes": ["selser"], "changes": [ ["meta", "before", "

plop

"] ] } annotations=1 !! wikitext hello !! wikitext/edited plop hello plop !! end !! test Selser: add content after and tags should keep paragraphs !! options parsoid={ "modes": ["selser"], "changes": [ ["meta", "after", "

plop2

"] ] } annotations=1 !! wikitext hello !! wikitext/edited plop2 hello plop2 !! end !! test Selser: add headings after and tags should yield the right amount of new lines !!options parsoid={ "modes": ["selser"], "changes": [ ["meta", "after", "

plop

"] ] } annotations=1 !! wikitext ==title== some paragraph hello some other paragraph !! wikitext/edited ==title== some paragraph == plop == hello == plop == some other paragraph !! end !! test Selser: add headings before and tags should yield the right amount of new lines !!options parsoid={ "modes": ["selser","wt2wt"], "changes": [ ["meta", "before", "

plop

"] ] } annotations=1 !!wikitext ==title== some paragraph hello some other paragraph !!wikitext/edited ==title== some paragraph == plop == hello == plop == some other paragraph !! end !! test Selser: add lists before and tags should yield the right amount of new lines !! options parsoid={ "modes": ["selser"], "changes": [ ["meta", "before", "
  • plop
"] ] } annotations=1 !! wikitext ==title== some paragraph hello some other paragraph !!wikitext/edited ==title== some paragraph * plop hello * plop some other paragraph !! end !! test Selser: add lists after and tags should yield the right amount of new lines !!options parsoid={ "modes": ["selser"], "changes": [ ["meta", "after", "
  • plop
"] ] } annotations=1 !! wikitext ==title== some paragraph hello some other paragraph !!wikitext/edited ==title== some paragraph * plop hello * plop some other paragraph !! end !! test T295330 - dsr computation should allow proper selser !! options annotations=1 !! wikitext '''The quick brown fox jumps over the lazy dog.''' [[Category:Foo]] !! html/parsoid

The quick brown fox jumps over the lazy dog.

!! end ## FIXME: This is currently awkward where only the start of the dummyanno is pulled into the template range. ## This doesn't affect correctness because the ranges are all marked extended (because of bad nesting). ## But, the bad nesting is an artefact of how the paragraph wrapper leaves the opening and closing meta ## tags of the annotation range in different paragraphs, and one of those paragraphs happen to be from ## a template. If the p-wrapper can be tweaked to be smarter about this, this will get cleaned up better. ## But, for now, the focus is on not breaking selser. !! test Top-level metas should not be migrated into paragraphs, nor pulled in the template !! options parsoid=wt2html,selser,wt2wt annotations=1 !! wikitext {{1x|
a
b}} c !! html/parsoid
a

b

c

!! end !! test Annotations should not be hoisted out of headers !! wikitext == Organizational and Planning Projects== !! options annotations=1 !! html/parsoid

Organizational and Planning Projects

!! end # Fixing T296169 in an imperfect way - see AnnotationDOMRangeBuilder.php#removeNestedRanges for details # This test purposefully fails on wt2wt, but we want to keep the output as part of the tests results. # Selser failures are also due to the wt2wt discrepancy. !! test T296169: Nested annotations should be dropped in HTML output !! options parsoid={ "modes": ["wt2html", "selser", "wt2wt"] } annotations=1 !! wikitext t1 t2 t3 !! html/parsoid

t1 t2 t3

!! end # T296169 !! test T296169: Extended annotations that yield a nested annotation should not nest said annotation !! options parsoid={ "modes": ["wt2html", "selser", "wt2wt"] } annotations=1 !! wikitext a ''b'' c ''d e f'' g !! html/parsoid

a b c d e f g

!! end !! test # This is not correct yet because the template is not expanded in the HTML - the template is considered as a raw string # instead. Follow-up as T299523. Annotations with templated annotation attribute shouldn't emit a warning and should round-trip !! options annotations=1 !! wikitext test !! html/parsoid

test

!! end !! test Annotations with templated annotation attribute name shouldn't emit a warning and should round-trip !! options annotations=1 !! wikitext test !! html/parsoid

test

!! end !! test Annotations with templated annotation attribute value shouldn't emit a warning and should round-trip !! options annotations=1 !! wikitext test !! html/parsoid

test

!! end !! test Annotation around a heading should not break the heading !! options annotations=1 !! wikitext ==plop== !! html/parsoid

plop

!! end !! test New lines around table-spanning annotation range extension should be maintained in selser !! options annotations=1 parsoid=wt2html,wt2wt,selser !! wikitext txt1 {| |- txt2 |text3 |} txt4 !! html/parsoid

txt1

txt2

text3

txt4

!! end !! test Extended ranges should not result in bad nesting (T306186) !! options annotations=1 parsoid=wt2html,selser !! wikitext text by someone Highway of Montenegro. by Albin Olsson, CC BY-SA 4.0. Greta Salóme, singing for Iceland. by Albin Olsson, CC BY-SA 4.0. Nina Kraljić, representing Croatia. !! html/parsoid

text by someone

Highway of Montenegro. by Albin Olsson, CC BY-SA 4.0.

Greta Salóme, singing for Iceland. by Albin Olsson, CC BY-SA 4.0.

Nina Kraljić, representing Croatia.

!! end # Looks like the comment, and the whitespace before 'Purge' are all needed. # Also, adding anything before the {{{1|..}} also leads to the test passing # without the T307172 fix. # So, this is a narrow edge case specific to this wikitext form. !! test T307172 Regression test !! options annotations=1 parsoid=wt2html !! wikitext {{{1| Purge}}} !! html/parsoid
Purge
!! end