From 0366498177584befce06fc6cc4b1913dea904e5e Mon Sep 17 00:00:00 2001 From: Arlo Breault Date: Wed, 22 Feb 2017 09:10:42 -0800 Subject: [PATCH] Sync up with Parsoid parserTests.txt This now aligns with Parsoid commit e23a818554548cd922ee262ea1d8da47ea457248 Change-Id: Ib26b170c51aa4425a54871fa32543b2eef5db41e --- tests/parser/parserTests.txt | 751 ++++------------------------------- 1 file changed, 82 insertions(+), 669 deletions(-) diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 35b01907f3..7060c4d3fd 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -1488,9 +1488,11 @@ nowiki 3 Entities inside !! wikitext < -!! html +!! html/php

<

+!! html/parsoid +

<

!! end !! test @@ -2311,8 +2313,12 @@ Entities inside
 
Foo →bar
!! end +## Don't expect this to rt, Parsoid drops the unmatched closing pre tags that +## aren't enclosed in nowikis. !! test and
 preference (first one wins)
+!! options
+parsoid=wt2html
 !! wikitext
 
 
@@ -2341,17 +2347,16 @@ Entities inside 
 </pre>
 

!! html/parsoid -
<nowiki>
+
<nowiki>
 
-

</nowiki> -</pre>

+

</nowiki>

+

<pre> <nowiki> </pre> - -</pre>

+

!! end !! test @@ -2366,8 +2371,6 @@ Entities inside
 # Parsoid doesn't strip empty tags, like Tidy does.
 !! test
 Empty pre; pre inside other HTML tags (T56946)
-!! options
-parsoid=wt2html,wt2wt
 !! wikitext
 a
 
@@ -2392,9 +2395,9 @@ foo
 !! html/parsoid
 

a

-
foo
+
foo
 
-

+

 !! end
 
 !! test
@@ -2410,7 +2413,7 @@ HTML pre followed by indent-pre
 
 # Note that tidy removes the empty 

tags from the start and end. # Parsoid does not, by design. -!!test +!! test Block tag pre !! wikitext

foo

@@ -2419,8 +2422,8 @@ Block tag pre foo
!! html/parsoid -

foo

-!!end +

foo

+!! end !!test Templates: Indent-Pre: 1a. Templates that break a line should suppress
@@ -2541,8 +2544,11 @@ Templates: Indent-Pre: 1f: Wrapping should be based on expanded content
 
!!end +## Hmm, should Parsoid rt this? !! test Pres with newline attributes +!! options +parsoid=wt2html,html2html !! wikitext
hi
@@ -2550,8 +2556,7 @@ two">hi
hi
!! html/parsoid -
hi
+
hi
!! end !! test @@ -2583,7 +2588,7 @@ x

<pre

!! html/parsoid -
x
+
x

<pre

@@ -2601,7 +2606,7 @@ parsoid=wt2html
{{echo|foo}}
!! html/parsoid -
{{echo|foo}}
+
{{echo|foo}}
!! end # TODO / maybe: fix wt2wt for this @@ -3266,6 +3271,17 @@ array ( a

 !! end
 
+!! test
+5. Indent-Pre and html pre
+!! wikitext
+ 
hi
+!! html/php +
hi
+ +!! html/parsoid +
hi
+!! end + !!test Render paragraphs when indent-pre is suppressed in blocklevels !! wikitext @@ -3455,18 +3471,17 @@ foo foo
!! html/parsoid -
foo
+
foo
-
-foo
+
foo
 
-
+
 
 foo
 
-
+
 
 
 foo
@@ -3510,7 +3525,7 @@ haha
 
 
!! html/parsoid -
+
 
 
 
@@ -3561,7 +3576,7 @@ HTML-pre: 3: other wikitext
 
!! html/parsoid -
* foo
+
* foo
 # bar
 = no-h =
 '' no-italic ''
@@ -6969,12 +6984,6 @@ Wikitext table with html-syntax row
 foo
 !! end
 
-## Note that Parsoid output differs from PHP and PHP+tidy here.
-## The lack of  tags in the PHP output is arguably a bug in the
-## PHP parser, which tidy then compounds by fostering the content
-## entirely out of the table.  Parsoid recognizes the table context
-## and generates  and  wrappers as needed.  Hopefully nobody
-## depends on PHP's treatment of broken table markup!
 !! test
 Implicit  after a |-
 !! options
@@ -6993,56 +7002,12 @@ a
 !! html/php+tidy
 

a

!! html/parsoid - - -
a
-!! end - -# Again, Parsoid adds implicit s here, PHP and Tidy strip the b out. -!! test -
 tags should be recognized in an explicit  context, but not in an implicit  context
-!! options
-parsoid=wt2html,html2html
-!! wikitext
-{|
-|-
-|
- a
-|-
- b
-|}
-!! html/php
-
-
-
-
- b
-
-
a
-
-
+

a

+ -!! html/php+tidy -

b

-
- - - -
-
-a
-
-!! html/parsoid - - - - - -
a
b
+ !! end -# PHP + Tidy strips the list out of the table; Parsoid wraps it. -# Parsoid generates the missing , so wt2wt won't succeed. !! test Lists should be recognized in an implicit context !! options @@ -7063,13 +7028,10 @@ parsoid=wt2html,html2html
  • a
  • !! html/parsoid - - - - -
      -
    • a
    • -
    +
    • a
    + + +
    !! end !! test @@ -7090,8 +7052,7 @@ Table cells not properly parsed in an implicit-td context !! html/parsoid - -
    a b
    + a b !! end !! test @@ -7531,7 +7492,7 @@ Piped link with no link text !! test Piped link with empty link text !! wikitext -[[Main Page|]] - empty nowiki +[[Main Page|]] - empty nowiki [[Main Page| ]] - empty space [[Main Page| ]] - empty non breaking space !! html/php @@ -7540,7 +7501,7 @@ Piped link with empty link text   - empty non breaking space

    !! html/parsoid -

    - empty nowiki +

    - empty nowiki - empty space   - empty non breaking space

    !! end @@ -7881,6 +7842,22 @@ Link containing double quotes and spaces

    Cool "Gator"

    !! end +!! test +File containing double quotes and spaces +!! wikitext +[[File:Cool "Gator".png]] +!! html/parsoid +

    +!! end + +!! test +Redirect containing double quotes and spaces +!! wikitext +#REDIRECT [[Cool "Gator"]] +!! html/parsoid + +!! end + !! test Link containing double-single-quotes '' in text (T6598 sanity check) !! wikitext @@ -8641,7 +8618,7 @@ Blah blah blah !! end !! test -Escaping of interlanguage links +Escaping of interlanguage links (T129218, T156308) !! wikitext Blah blah blah [[:es:Spanish]] @@ -8652,7 +8629,8 @@ Blah blah blah zh : Chinese

    !! html/parsoid -

    es:Spanish +

    Blah blah blah +es:Spanish zh : Chinese

    !! end @@ -9487,8 +9465,8 @@ List items are not parsed correctly following a
     block (T2785)
     
  • zar
  • !! html/parsoid -
    • foo
    • -
    • bar
    • +
      • foo
      • +
      • bar
      • zar
      !! end @@ -17918,7 +17896,7 @@ http://example.comjunk

      http://example.comjunk

      !! end -!!test +!! test Fuzz testing: URL adjacent extension (no space, dirty; pre) !! wikitext http://example.com
      junk
      @@ -17931,10 +17909,10 @@ http://example.com
      junk
      junk
    !! html/parsoid -

    http://example.com

    junk
    -!!end +

    http://example.com

    junk
    +!! end -!!test +!! test Fuzz testing: image with bogus manual thumbnail !! wikitext [[Image:foobar.jpg|thumbnail= ]] @@ -17943,15 +17921,17 @@ Fuzz testing: image with bogus manual thumbnail !! html/parsoid
    -!!end +!! end !! test Fuzz testing: encoded newline in generated HTML replacements (T8577) !! wikitext
    
    -!! html
    +!! html/php
     
    
     
    +!! html/parsoid
    +
    
     !! end
     
     !! test
    @@ -20750,9 +20730,6 @@ Nested: -{zh-hans:Hi -{zh-cn:China;zh-sg:Singapore;}-;zh-hant:Hello -{zh-tw:Taiw
     

    !! end -# Since Parsoid is starting to emit canonical wikitext for links, -# [http://example.com http://example.com] will not RT back to that -# form anymore. !! test HTML markups with conversion syntax in attribs, nested in other conversion blocks !! options @@ -20775,6 +20752,9 @@ language=zh variant=zh-cn disabled

    !! end +# Since Parsoid is starting to emit canonical wikitext for links, +# [http://example.com http://example.com] will not RT back to that +# form anymore. !! test Proper conversion of text in external links !! options @@ -22758,573 +22738,6 @@ parsoid=wt2html,wt2wt

    !! end -#### ---------------------------------------------------------------- -#### Parsoid-only testing of Parsoid's impl of and -#### tags. Parsoid's output for these tags differs from that of the -#### PHP parser. -#### ---------------------------------------------------------------- - -!!test -Ref: 1. ref-location should be replaced with an index span -!! wikitext -A foo -B foo -C - -!! html/parsoid -

    A [1] -B [2] -C [3]

    -
      -
    1. ↑ foo
    2. -
    3. ↑ foo
    4. -
    5. ↑
    6. -
    -!!end - -!!test -Ref: 2. ref-tags with identical names should all get the same index -!! wikitext -A foo -B - -!! html/parsoid -

    A [1] -B [1]

    -
      -
    1. 1 2 foo
    2. -
    -!!end - -!!test -Ref: 3. spaces in ref-names should be ignored -!! wikitext -A foo -B -C - -!! html/parsoid -

    A [1] -B [1] -C [1]

    -
      -
    1. 1 2 3 foo
    2. -
    -!!end - -# NOTE: constructor is a predefined property in JS and constructor as a ref-name can clash with it if not handled properly) -!!test -Ref: 4. 'constructor' should be accepted as a valid ref-name -!! wikitext -A foo - -!! html/parsoid -

    A [1]

    -
      -
    1. ↑ foo
    2. -
    -!!end - -!!test -Ref: 5. body should accept generic wikitext -!! wikitext -A - This is a '''[[bolded link]]''' and this is a {{echo|transclusion}} - - - -!! html/parsoid -

    A [1]

    - -
      -
    1. ↑ This is a bolded link and this is a transclusion -
    2. -
    -!!end - -!!test -Ref: 6. indent-pres should not be output in ref-body -!! wikitext -A - foo - bar - baz - - - -!! html/parsoid -

    A [1]

    - -
      -
    1. ↑ foo - bar - baz -
    2. -
    -!!end - -!!test -Ref: 7. No p-wrapping in ref-body -!! wikitext -A -foo - -bar - - -baz - - - -booz - - - -!! html/parsoid -

    A [1]

    - -
      -
    1. ↑ foo - -bar - - -baz - - - -booz -
    2. -
    -!!end - -!!test -Ref: 8. transclusion wikitext has lower precedence -!! wikitext -A foo {{echo| B C}} - - -!! html/parsoid -

    A [1] B C}}

    -
      -
    1. ↑ foo {{echo|
    2. -
    -!!end - -!!test -Ref: 9. unclosed comments should not leak out of ref-body -!! wikitext -A foo - -!!end - -!!test -Ref: 10. Unclosed HTML tags should not leak out of ref-body -!! wikitext -A foo B C - - -!! html/parsoid -

    A [1] B C

    - - -
      -
    1. ↑ foo
    2. -
    -!!end - -!!test -Ref: 11. ref-tags acts like an inline element wrt P-wrapping -!! wikitext -A foo B -C bar D - -!! html/parsoid -

    A [1] B -C [2] D

    -
      -
    1. ↑ foo
    2. -
    3. ↑ bar
    4. -
    -!!end - -!!test -Ref: 12. ref-tags act as trailing newline migration barrier -!! wikitext -a - -b - - -c - -!! html/parsoid -

    a

    - - -

    b [1] -[2]

    - -

    c

    -
      -
    1. ↑
    2. -
    3. ↑
    -!!end - -!!test -Ref: 13. ref-tags are not SOL-transparent and block indent-pres -!! wikitext -foo A -bar - B - -!! html/parsoid -

    [1] A -[2] B

    -
      -
    1. ↑ foo
    2. -
    3. ↑ bar -
    4. -
    -!!end - -## Roundtripping fails because of nowiki'ing -!! test -Ref: 14. A nested ref-tag should be emitted as plain text -!! options -parsoid=wt2html -!! wikitext -foo bar baz - - -!! html/parsoid -

    [1] baz</ref>

    - -
    1. ↑ foo <ref>bar
    -!! end - -!!test -Ref: 15. ref-tags with identical names should get identical indexes -!! wikitext -A1 foo A2 -B1 B2 bar - - -!! html/parsoid -

    A1 [1] A2 [1] -B1 [2] B2 [2]

    - -
    1. 1 2 foo
    2. 1 2 bar
    3. -
    -!!end - -## We don't bother wt2wt-ing non-standard whitespace -!!test -Ref: 16. Tokenizer should accept non-standard whitespace in and tags -!!options -parsoid=wt2html -!! wikitext -A foo - - -!! html/parsoid -

    A [1]

    -
      -
    1. ↑ foo
    -!!end - -!!test -Ref: 17. Generate valid HTML5 id/about attributes -!!wikitext -foo -ve-created name - - -!!html/parsoid -

    [1] -[2] - -

    1. ↑ foo
    2. ↑ ve-created name
    - -!!end - -!!test -Ref: 18. T58916: Extension attributes should be parsed as plain text -!!wikitext -foo - - -!!html/parsoid -

    [1] -

    - -
      -
    1. ↑ foo
    2. -
    -!!end - -!!test -Ref: 19. ref-tags with identical name encodings should get identical indexes -!! wikitext -1 foo 2 - - -!! html/parsoid -

    1 [1] 2 [1] -

    -
      -
    1. 1 2 foo
    2. -
    -!!end - -!!test -Ref: 20. ref-tags with identical names but different content should keep it -!! wikitext -A Foo one -B Foo two -C - - -!! html/parsoid -

    A [1] -B [1] -C [1]

    - -
    1. 1 2 3 Foo one
    2. -
    -!!end - -!!test -References: 1. references tag without any refs should be handled properly -!! wikitext - -!! html/parsoid -
      -!!end - -!!test -References: 2. references tag with group only outputs references from that group -!! wikitext -A foo -B bar -C baz - - - - -!! html/parsoid -

      A [a 1] -B [b 1] -C [1]

      - -
        -
      1. ↑ foo
      2. -
      -
        -
      1. ↑ baz
      2. -
      -
        -
      1. ↑ bar
      2. -
      -!!end - -!!test -References: 3. ref list should be cleared after processing references -!! wikitext -A foo - - - -B bar - - -!! html/parsoid -

      A [1]

      - -
      1. ↑ foo
      2. -
      - -

      B [1]

      - -
        -
      1. ↑ bar
      2. -
      -!!end - -!!test -References: 4. only referenced group should be cleared after processing references -!! wikitext -A afoo -B bfoo - - - -C cfoo - - -!! html/parsoid -

      A [a 1] -B [1]

      - -
      1. ↑ afoo
      2. -
      - -

      C [2]

      - -
      1. ↑ bfoo
      2. ↑ cfoo
      3. -
      -!!end - -## Don't expect this to rt since we're dropping content -!! test -References: 5. ref tags in references should be processed while ignoring all other content -!! options -parsoid=wt2html,html2html -!! wikitext -A -B bar - - -foo -This should just get lost. - -!! html/parsoid -

      A [1] -B [2]

      - - -
      1. ↑ foo
      2. ↑ bar
      3. -
      -!! end - -!! test -References: 6. from a transclusion -!! wikitext -Foo {{echo|}} -!! html/parsoid -

      [1]

      1. ↑ Foo
      2. -
      -!! end - -!! test -References: 7. Multiple references tags (one without and one with nested refs) should be correctly handled -!! wikitext -A foo bar for a -B - - - - -foo - -!! html/parsoid -

      A [1] -B [X 1] -

      - -
        -
      1. ↑ foo bar for a
      2. -
      - -
        -
      1. ↑ foo
      2. -
      -!! end - -!! test -References: 8. T88019: Remove s from templates inside that's itself inside a template -!! wikitext -X{{echo|foo {{echo|bar}} and {{echo|baz}} boo}} - -!! html/parsoid -

      X[1]

      -
      1. ↑ foo bar and baz boo
      2. -
      -!!end - -# This test only works in wt2html now as the are always generated -# unless selser is active. Once T72722 is fixed, we should add a changes test -# here to ensure that unrelated changes don't add the new -# when selser is active. -!! test -References: 9. Generate missing references list at the end -!! wikitext -A foo -B bar -!! html/parsoid -

      A [1] B [inexistent 1]

      -
        -
      1. ↑ foo
      2. -
      -
        -
      1. ↑ bar
      2. -
      -!! end - -!! test -References: 10. New shouldn't be added for unrelated edits. -!! options -parsoid={ - "modes": ["selser"], - "changes": [["#x", "remove"]], - "selser": "noauto" -} -!! wikitext -Unrelated text that's going to disappear. -A foo -!! wikitext/edited -Unrelated text. -A foo -!!end - -!! test -Entities in ref name -!! wikitext -hi - -!! html/parsoid -

      [1]

      -
        -
      1. ↑ hi
      2. -
      -!! end - -## The output here may look funny, but it's what the php parser will do. The -## unclosed references tag becomes escaped text, and then a new references -## tag is auto-generated. The test is wt2html only because it roundtrips with -## nowiki tags, and the auto-generated references tag is only dropped in -## rtTestMode. -!! test -Generate references for unclosed references tag -!! options -parsoid=wt2html -!! wikitext -afoo - - -!! html/parsoid -

      a[1]

      - -

      <references>

      -
      1. ↑ foo
      -!! end - -!! test -New reference serializes on its own line -!! options -parsoid=wt2wt,html2wt -!! wikitext -foo - -!! html/parsoid -foo
        -!! end - #### ---------------------------------------------------------------- #### Parsoid-only testing of Parsoid's impl of LST #### Not implemented yet, see @@ -26814,7 +26227,7 @@ WTS of autolinks with escapes (editing) parsoid={ "modes": ["wt2wt"], "changes": [ - [ "meta", "remove" ] + [ "span", "remove" ] ] } !! wikitext -- 2.20.1