From: Subramanya Sastry Date: Thu, 1 Mar 2018 23:02:54 +0000 (-0600) Subject: RFC T157418: Trim whitespace in table cells, list items, headings X-Git-Tag: 1.31.0-rc.0~338^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=30495ea1f904953784fb36751d55da233d616215;p=lhc%2Fweb%2Fwiklou.git RFC T157418: Trim whitespace in table cells, list items, headings * Matmarex had implemented this for wikitext headings in b3dd3881. * This patch extends this to wikitext list items and wikitext table cells. * Updated RELEASE NOTES. tests/parser/parserTests.txt: * All whitespace removed in output of list items, table cells, and headings. Removed corresponding whitespace in the input wikitext except for a few tests where the whitespace is significant "| +" or "| -", for example. * Updated output of html/parsoid sections as well. * Added new tests to spec white-space trimming behavior. tests/phpunit/*: * Fixed a few tests that used whitespace in list items and table cells. Bug: T157418 Change-Id: I8ea34c7ab893c0c125c81d810feeb3c581e4bba1 --- diff --git a/RELEASE-NOTES-1.31 b/RELEASE-NOTES-1.31 index 7b2ece99b5..e5226eca40 100644 --- a/RELEASE-NOTES-1.31 +++ b/RELEASE-NOTES-1.31 @@ -293,6 +293,10 @@ changes to languages because of Phabricator reports. can use ApiOpenSearch::getOpenSearchTemplate() instead. * The global function wfBaseConvert, deprecated in 1.27, has been removed. Use Wikimedia\base_convert() directly. +* RFC 157418: Whitespace is trimmed from wikitext headings, wikitext list items, + wikitext table captions, wikitext table headings, wikitext table cells. HTML + headings, HTML list items, HTML table captions, HTML table headings, HTML table cells + will not have this trimming behavior. == Compatibility == MediaWiki 1.31 requires PHP 5.5.9 or later. Although HHVM 3.18.5 or later is supported, diff --git a/includes/parser/BlockLevelPass.php b/includes/parser/BlockLevelPass.php index 7f7891268f..acdc652806 100644 --- a/includes/parser/BlockLevelPass.php +++ b/includes/parser/BlockLevelPass.php @@ -236,7 +236,8 @@ class BlockLevelPass { $term = $t2 = ''; if ( $this->findColonNoLinks( $t, $term, $t2 ) !== false ) { $t = $t2; - $output .= $term . $this->nextItem( ':' ); + // Trim whitespace in list items + $output .= trim( $term ) . $this->nextItem( ':' ); } } } elseif ( $prefixLength || $lastPrefixLength ) { @@ -274,7 +275,8 @@ class BlockLevelPass { # @todo FIXME: This is dupe of code above if ( $this->findColonNoLinks( $t, $term, $t2 ) !== false ) { $t = $t2; - $output .= $term . $this->nextItem( ':' ); + // Trim whitespace in list items + $output .= trim( $term ) . $this->nextItem( ':' ); } } ++$commonPrefixLength; @@ -371,9 +373,12 @@ class BlockLevelPass { $this->inPre = false; } if ( $pendingPTag === false ) { - $output .= $t; if ( $prefixLength === 0 ) { + $output .= $t; $output .= "\n"; + } else { + // Trim whitespace in list items + $output .= trim( $t ); } } } diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 945872887f..e54588750b 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -1113,7 +1113,11 @@ class Parser { $line = "{$line}"; } array_pop( $tr_attributes ); - $outLine = $line . str_repeat( '', $indent_level ); + if ( $indent_level > 0 ) { + $outLine = rtrim( $line ) . str_repeat( '', $indent_level ); + } else { + $outLine = $line; + } } elseif ( $first_two === '|-' ) { # Now we have a table row $line = preg_replace( '#^\|-+#', '', $line ); @@ -1204,13 +1208,15 @@ class Parser { # be mistaken as delimiting cell parameters # Bug T153140: Neither should language converter markup. if ( preg_match( '/\[\[|-\{/', $cell_data[0] ) === 1 ) { - $cell = "{$previous}<{$last_tag}>{$cell}"; + $cell = "{$previous}<{$last_tag}>" . trim( $cell ); } elseif ( count( $cell_data ) == 1 ) { - $cell = "{$previous}<{$last_tag}>{$cell_data[0]}"; + // Whitespace in cells is trimmed + $cell = "{$previous}<{$last_tag}>" . trim( $cell_data[0] ); } else { $attributes = $this->mStripState->unstripBoth( $cell_data[0] ); $attributes = Sanitizer::fixTagAttributes( $attributes, $last_tag ); - $cell = "{$previous}<{$last_tag}{$attributes}>{$cell_data[1]}"; + // Whitespace in cells is trimmed + $cell = "{$previous}<{$last_tag}{$attributes}>" . trim( $cell_data[1] ); } $outLine .= $cell; @@ -4050,6 +4056,7 @@ class Parser { # Get all headlines for numbering them and adding funky stuff like [edit] # links - this is for later, but we need the number of headlines right now + # This regexp also trims whitespace in the heading's content $matches = []; $numMatches = preg_match_all( '/[1-6])(?P.*?>)\s*(?P
[\s\S]*?)\s*<\/H[1-6] *>/i', diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index f98044b57c..261bce1b85 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -534,8 +534,8 @@ parsoid=wt2html !! config wgFragmentMode=[ 'html5', 'legacy' ] !! wikitext -== A B -C == +==A B +C== !! html/php

A B @@ -543,8 +543,8 @@ C[ A B -C

+C">A B +C !! end !! test @@ -560,48 +560,48 @@ http://fr.wikipedia.org/wiki/🍺 !! test Simple list !! wikitext -* Item 1 -* Item 2 +*Item 1 +*Item 2 !! html -
  • Item 1
  • -
  • Item 2
+
  • Item 1
  • +
  • Item 2
!! end !! test Italics and bold !! wikitext -* plain -* plain''italic''plain -* plain''italic''plain''italic''plain -* plain'''bold'''plain -* plain'''bold'''plain'''bold'''plain -* plain''italic''plain'''bold'''plain -* plain'''bold'''plain''italic''plain -* plain''italic'''bold-italic'''italic''plain -* plain'''bold''bold-italic''bold'''plain -* plain'''''bold-italic'''italic''plain -* plain'''''bold-italic''bold'''plain -* plain''italic'''bold-italic'''''plain -* plain'''bold''bold-italic'''''plain -* plain l'''italic''plain -* plain l''''bold''' plain -!! html -
  • plain
  • -
  • plainitalicplain
  • -
  • plainitalicplainitalicplain
  • -
  • plainboldplain
  • -
  • plainboldplainboldplain
  • -
  • plainitalicplainboldplain
  • -
  • plainboldplainitalicplain
  • -
  • plainitalicbold-italicitalicplain
  • -
  • plainboldbold-italicboldplain
  • -
  • plainbold-italicitalicplain
  • -
  • plainbold-italicboldplain
  • -
  • plainitalicbold-italicplain
  • -
  • plainboldbold-italicplain
  • -
  • plain l'italicplain
  • -
  • plain l'bold plain
+*plain +*plain''italic''plain +*plain''italic''plain''italic''plain +*plain'''bold'''plain +*plain'''bold'''plain'''bold'''plain +*plain''italic''plain'''bold'''plain +*plain'''bold'''plain''italic''plain +*plain''italic'''bold-italic'''italic''plain +*plain'''bold''bold-italic''bold'''plain +*plain'''''bold-italic'''italic''plain +*plain'''''bold-italic''bold'''plain +*plain''italic'''bold-italic'''''plain +*plain'''bold''bold-italic'''''plain +*plain l'''italic''plain +*plain l''''bold''' plain +!! html +
  • plain
  • +
  • plainitalicplain
  • +
  • plainitalicplainitalicplain
  • +
  • plainboldplain
  • +
  • plainboldplainboldplain
  • +
  • plainitalicplainboldplain
  • +
  • plainboldplainitalicplain
  • +
  • plainitalicbold-italicitalicplain
  • +
  • plainboldbold-italicboldplain
  • +
  • plainbold-italicitalicplain
  • +
  • plainbold-italicboldplain
  • +
  • plainitalicbold-italicplain
  • +
  • plainboldbold-italicplain
  • +
  • plain l'italicplain
  • +
  • plain l'bold plain
!! end @@ -1247,32 +1247,32 @@ Text-level semantic html elements in wikitext !! test Ruby markup (W3C-style) !! wikitext -; Mono-ruby for individual base characters -: 日に本ほん語ご -; Group ruby -: 今日きょう -; Jukugo ruby -: 法華経ほけきょう -; Inline ruby -: 東京(とうきょう) -; Double-sided ruby -: 旧金山jiùjīnshānSan Francisco +;Mono-ruby for individual base characters +:日に本ほん語ご +;Group ruby +:今日きょう +;Jukugo ruby +:法華経ほけきょう +;Inline ruby +:東京(とうきょう) +;Double-sided ruby +:旧金山jiùjīnshānSan Francisco ♥HeartCœur ☘ShamrockTrèfle ✶StarÉtoile !! html -
Mono-ruby for individual base characters
-
日に本ほん語ご
-
Group ruby
-
今日きょう
-
Jukugo ruby
-
法華経ほけきょう
-
Inline ruby
-
東京(とうきょう)
-
Double-sided ruby
-
旧金山jiùjīnshānSan Francisco
+
Mono-ruby for individual base characters
+
日に本ほん語ご
+
Group ruby
+
今日きょう
+
Jukugo ruby
+
法華経ほけきょう
+
Inline ruby
+
東京(とうきょう)
+
Double-sided ruby
+
旧金山jiùjīnshānSan Francisco

♥HeartCœur ☘ShamrockTrèfle @@ -2751,7 +2751,7 @@ Templates: Strip leading and trailing whitespace from named-param values

b

c

-
  • d
+
  • d
!! end @@ -2772,7 +2772,7 @@ Templates: Don't strip whitespace from positional-param values e}} {{echo| -* f}} +*f}} {{echo| }}g @@ -2792,7 +2792,7 @@ Templates: Don't strip whitespace from positional-param values


-
  • f
+
  • f


g
@@ -3168,15 +3168,15 @@ c
 2c. Indent-Pre and tables (T44252)
 !! wikitext
 {|
- |+ foo
- !  | bar
+ |+foo
+ !  |bar
 |}
 !! html
 
-
-
foo +foo
bar +bar
!!end @@ -3186,14 +3186,14 @@ c !! wikitext a {| - | b + |b |} !! html/php
a
 
-
b +b
!! html/parsoid @@ -3699,19 +3699,19 @@ HTML-pre: 3: other wikitext !! test Simple definition !! wikitext -; name : Definition +;name :Definition !! html -
name 
-
Definition
+
name 
+
Definition
!! end !! test Definition list for indentation only !! wikitext -: Indented text +:Indented text !! html -
Indented text
+
Indented text
!! end @@ -3728,10 +3728,10 @@ Definition list with no space !! test Definition list with URL link !! wikitext -; http://example.com/ : definition +;http://example.com/ :definition !! html -
http://example.com/ 
-
definition
+
http://example.com/ 
+
definition
!! end @@ -3748,10 +3748,10 @@ Definition list with bracketed URL link !! test Definition list with wikilink containing colon !! wikitext -; [[Help:FAQ]]: The least-read page on Wikipedia +; [[Help:FAQ]]:The least-read page on Wikipedia !! html -
Help:FAQ
-
The least-read page on Wikipedia
+
Help:FAQ
+
The least-read page on Wikipedia
!! end @@ -3759,13 +3759,13 @@ Definition list with wikilink containing colon !! test Definition list with news link containing colon !! wikitext -; news:alt.wikipedia.rox: This isn't even a real newsgroup! +;news:alt.wikipedia.rox: This isn't even a real newsgroup! !! html/php -
news:alt.wikipedia.rox
-
This isn't even a real newsgroup!
+
news:alt.wikipedia.rox
+
This isn't even a real newsgroup!
!! html/parsoid -
news:alt.wikipedia.rox
This isn't even a real newsgroup!
+
news:alt.wikipedia.rox
This isn't even a real newsgroup!
!! end !! test @@ -3773,17 +3773,17 @@ Malformed definition list with colon !! wikitext ; news:alt.wikipedia.rox -- don't crash or enter an infinite loop !! html -
news:alt.wikipedia.rox -- don't crash or enter an infinite loop
+
news:alt.wikipedia.rox -- don't crash or enter an infinite loop
!! end !! test Definition lists: colon in external link text !! wikitext -; [http://www.wikipedia2.org/ Wikipedia : The Next Generation]: OK, I made that up +;[http://www.wikipedia2.org/ Wikipedia :The Next Generation] :OK, I made that up !! html -
Wikipedia : The Next Generation
-
OK, I made that up
+
Wikipedia :The Next Generation 
+
OK, I made that up
!! end @@ -3799,30 +3799,30 @@ Definition lists: colon in HTML attribute !! test Definition lists: self-closed tag !! wikitext -;one
two : two-line fun +;one
two :two-line fun !! html
one
two 
-
two-line fun
+
two-line fun
!! end !! test Definition lists: ignore colons inside tags !! wikitext -;one two : tag fun::: def +;one two : tag fun:::def !! html
one two : tag fun::
-
def
+
def
!! end !! test Definition lists: excess closed tags !! wikitext -;onetwo : bad tag fun +;onetwo :bad tag fun !! html/php+tidy
onetwo 
-
bad tag fun
+
bad tag fun
!! html/parsoid
onetwo
@@ -3853,14 +3853,14 @@ T13748: Literal closing tags Definition and unordered list using wiki syntax nested in unordered list using html tags. !! wikitext
  • -; term : description -* unordered +;term :description +*unordered
!! html
  • -
    term 
    -
    description
    -
    • unordered
    +
    term 
    +
    description
    +
    • unordered
!! end @@ -3868,10 +3868,10 @@ Definition and unordered list using wiki syntax nested in unordered list using h !! test Definition list with empty definition and following paragraph !! wikitext -; term: +;term: Paragraph text !! html -
term
+
term

Paragraph text

@@ -4049,22 +4049,22 @@ Table / list interaction: indented table with lists in table contents !! wikitext :{| |- -| a -* b +|a +*b |- -| c -* d +|c +*d |} !! html
- -
a -
  • b
+
a +
  • b
c -
  • d
+
c +
  • d
!! end @@ -4172,30 +4172,30 @@ Definition Lists: Nesting: Test 4 !! test Definition Lists: Mixed Lists: Test 1 !! wikitext -:;* foo -::* bar -:; baz +:;*foo +::*bar +:;baz !! html/php -
  • foo
  • -
  • bar
-
baz
+
  • foo
  • +
  • bar
+
baz
!! html/php+tidy -
  • foo
  • -
  • bar
-
baz
+
  • foo
  • +
  • bar
+
baz
!! html/parsoid
    -
  • foo +
  • foo
    -
  • bar +
  • bar
-
baz
+
baz
!! end @@ -4203,11 +4203,11 @@ Definition Lists: Mixed Lists: Test 1 !! test Definition Lists: Mixed Lists: Test 2 !! wikitext -*: d1 -*: d2 +*:d1 +*:d2 !! html -
  • d1
    -
    d2
+
  • d1
    +
    d2
!! end @@ -4215,11 +4215,11 @@ Definition Lists: Mixed Lists: Test 2 !! test Definition Lists: Mixed Lists: Test 3 !! wikitext -*::: d1 -*::: d2 +*:::d1 +*:::d2 !! html -
  • d1
    -
    d2
+
  • d1
    +
    d2
!! end @@ -4242,10 +4242,10 @@ Definition Lists: Mixed Lists: Test 4 Definition Lists: Mixed Lists: Test 5 !! wikitext *:d1 -*:: d2 +*::d2 !! html
  • d1 -
    d2
+
d2
!! end @@ -4254,10 +4254,10 @@ Definition Lists: Mixed Lists: Test 5 Definition Lists: Mixed Lists: Test 6 !! wikitext #*:d1 -#*::: d3 +#*:::d3 !! html
    • d1 -
      d3
+
d3
!! end @@ -4265,11 +4265,11 @@ Definition Lists: Mixed Lists: Test 6 !! test Definition Lists: Mixed Lists: Test 7 !! wikitext -:* d1 -:* d2 +:*d1 +:*d2 !! html -
  • d1
  • -
  • d2
+
  • d1
  • +
  • d2
!! end @@ -4277,11 +4277,11 @@ Definition Lists: Mixed Lists: Test 7 !! test Definition Lists: Mixed Lists: Test 8 !! wikitext -:* d1 -::* d2 +:*d1 +::*d2 !! html -
  • d1
-
  • d2
+
  • d1
+
  • d2
!! end @@ -4382,10 +4382,10 @@ Definition Lists: Mixed Lists: Test 12 !! test Definition Lists: Weird Ones: Test 1 !! wikitext -*#;*::;; foo : bar (who uses this?) +*#;*::;;foo :bar (who uses this?) !! html/php+tidy -
    1. foo 
      -
      • bar (who uses this?)
+
    1. foo 
      +
      • bar (who uses this?)
!! html/parsoid
  • @@ -4402,8 +4402,8 @@ Definition Lists: Weird Ones: Test 1
    -
    foo 
    -
    bar (who uses this?)
    +
    foo 
    +
    bar (who uses this?)
    @@ -4460,29 +4460,29 @@ Definition Lists: colons occurring in tags Definition Lists: colons and tables 1 !! wikitext :{| -| x +|x |} :{| -| y +|y |} !! html/php
    -
    x +x
    -
    y +y
    !! html/parsoid
    -
    x +x
    -
    y +y
    !! end @@ -5543,61 +5543,61 @@ IPv6 urls, autolink format (T23261) http://[2404:130:0:1000::187:2]/index.php Examples from RFC 2373, section 2.2: -* http://[1080::8:800:200C:417A]/unicast -* http://[FF01::101]/multicast -* http://[::1]/loopback -* http://[::]/unspecified -* http://[::13.1.68.3]/ipv4compat -* http://[::FFFF:129.144.52.38]/ipv4compat +*http://[1080::8:800:200C:417A]/unicast +*http://[FF01::101]/multicast +*http://[::1]/loopback +*http://[::]/unspecified +*http://[::13.1.68.3]/ipv4compat +*http://[::FFFF:129.144.52.38]/ipv4compat Examples from RFC 2732, section 2: -* http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html -* http://[1080:0:0:0:8:800:200C:417A]/index.html -* http://[3ffe:2a00:100:7031::1] -* http://[1080::8:800:200C:417A]/foo -* http://[::192.9.5.5]/ipng -* http://[::FFFF:129.144.52.38]:80/index.html -* http://[2010:836B:4179::836B:4179] +*http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html +*http://[1080:0:0:0:8:800:200C:417A]/index.html +*http://[3ffe:2a00:100:7031::1] +*http://[1080::8:800:200C:417A]/foo +*http://[::192.9.5.5]/ipng +*http://[::FFFF:129.144.52.38]:80/index.html +*http://[2010:836B:4179::836B:4179] !! html/php

    http://[2404:130:0:1000::187:2]/index.php

    Examples from RFC 2373, section 2.2:

    - +

    Examples from RFC 2732, section 2:

    - + !! html/parsoid

    http://[2404:130:0:1000::187:2]/index.php

    Examples from RFC 2373, section 2.2:

    - +

    Examples from RFC 2732, section 2:

    - + !! end !! test @@ -5606,61 +5606,61 @@ IPv6 urls, bracketed format (T23261) [http://[2404:130:0:1000::187:2]/index.php test] Examples from RFC 2373, section 2.2: -* [http://[1080::8:800:200C:417A] unicast] -* [http://[FF01::101] multicast] -* [http://[::1]/ loopback] -* [http://[::] unspecified] -* [http://[::13.1.68.3] ipv4compat] -* [http://[::FFFF:129.144.52.38] ipv4compat] +*[http://[1080::8:800:200C:417A] unicast] +*[http://[FF01::101] multicast] +*[http://[::1]/ loopback] +*[http://[::] unspecified] +*[http://[::13.1.68.3] ipv4compat] +*[http://[::FFFF:129.144.52.38] ipv4compat] Examples from RFC 2732, section 2: -* [http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html 1] -* [http://[1080:0:0:0:8:800:200C:417A]/index.html 2] -* [http://[3ffe:2a00:100:7031::1] 3] -* [http://[1080::8:800:200C:417A]/foo 4] -* [http://[::192.9.5.5]/ipng 5] -* [http://[::FFFF:129.144.52.38]:80/index.html 6] -* [http://[2010:836B:4179::836B:4179] 7] +*[http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html 1] +*[http://[1080:0:0:0:8:800:200C:417A]/index.html 2] +*[http://[3ffe:2a00:100:7031::1] 3] +*[http://[1080::8:800:200C:417A]/foo 4] +*[http://[::192.9.5.5]/ipng 5] +*[http://[::FFFF:129.144.52.38]:80/index.html 6] +*[http://[2010:836B:4179::836B:4179] 7] !! html/php

    test

    Examples from RFC 2373, section 2.2:

    - +

    Examples from RFC 2732, section 2:

    - + !! html/parsoid

    test

    Examples from RFC 2373, section 2.2:

    - +

    Examples from RFC 2732, section 2:

    - + !! end !! test @@ -5988,15 +5988,15 @@ A table with no data (take 2) A table with nothing but a caption !! wikitext {| -|+ caption +|+caption |} !! html/php -
    caption +caption
    !! html/parsoid -
    caption
    +
    caption
    !! end !! test @@ -6005,14 +6005,14 @@ A table with caption with default-spaced attributes and a table row {| |+ style="color: red;" | caption1 |- -| foo +|foo |} !! html - -
    caption1 +caption1
    foo +foo
    !! end @@ -6022,18 +6022,18 @@ A table with captions with non-default spaced attributes and a table row !! wikitext {| |+style="color: red;"|caption2 -|+ style="color: red;"| caption3 +|+ style="color: red;"|caption3 |- -| foo +|foo |} !! html - -
    caption2 caption3 +caption3
    foo +foo
    !! end @@ -6042,23 +6042,23 @@ A table with captions with non-default spaced attributes and a table row Table td-cell syntax variations !! wikitext {| -| foo bar foo | baz -| foo bar foo || baz -| style='color:red;' | baz -| style='color:red;' || baz +|foo bar foo|baz +|foo bar foo||baz +|style='color:red;'|baz +|style='color:red;'||baz |} !! html - - - + - - - +
    baz +baz foo bar foo baz +foo bar foobaz baz +baz style='color:red;' baz +style='color:red;'baz
    !! end @@ -6067,19 +6067,19 @@ Table td-cell syntax variations Simple table !! wikitext {| -| 1 || 2 +|1||2 |- -| 3 || 4 +|3||4 |} !! html - - + - - +
    1 2 +12
    3 4 +34
    !! end @@ -6088,17 +6088,17 @@ Simple table Simple table but with multiple dashes for row wikitext !! wikitext {| -| foo +|foo |----- -| bar +|bar |} !! html - -
    foo +foo
    bar +bar
    !! end @@ -6109,67 +6109,67 @@ Multiplication table {| border="1" cellpadding="2" |+Multiplication table |- -! × !! 1 !! 2 !! 3 +!×!!1!!2!!3 |- -! 1 -| 1 || 2 || 3 +!1 +|1||2||3 |- -! 2 -| 2 || 4 || 6 +!2 +|2||4||6 |- -! 3 -| 3 || 6 || 9 +!3 +|3||6||9 |- -! 4 -| 4 || 8 || 12 +!4 +|4||8||12 |- -! 5 -| 5 || 10 || 15 +!5 +|5||10||15 |} !! html - - - - + + + - - - - + + - - - - + + - - - - + + - - - - + + - - - - + +
    Multiplication table
    × 1 2 3 +×123
    1 +1 1 2 3 +123
    2 +2 2 4 6 +246
    3 +3 3 6 9 +369
    4 +4 4 8 12 +4812
    5 +5 5 10 15 +51015
    !! end @@ -6178,13 +6178,13 @@ Multiplication table Accept "||" in table headings !! wikitext {| -!h1 || h2 +!h1||h2 |} !! html - - +
    h1 h2 +h1h2
    !! end @@ -6193,12 +6193,12 @@ Accept "||" in table headings Accept "!!" in table data !! wikitext {| -| Foo!! || +|Foo!!|| |} !! html - +
    Foo!! Foo!!
    @@ -6212,13 +6212,13 @@ Accept "!!" in table data Accept "||" in indented table headings !! wikitext :{| -!h1 || h2 +!h1||h2 |} !! html
    - - +
    h1 h2 +h1h2
    !! end @@ -6293,9 +6293,9 @@ Accept empty attributes in td/th cells (td/th cells starting with leading ||) !! html - -
    h1 +h1 a +a
    !! end @@ -6305,13 +6305,13 @@ Accept "| !" at start of line in tables (ignore !-attribute) !! wikitext {| |- -| !style="color:red" | bar +|!style="color:red"|bar |} !! html -
    bar +bar
    !!end @@ -6324,8 +6324,8 @@ Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present |style='color:red;'|+1 |style='color:blue;'|-1 |- -| 1 || 2 || 3 -| 1 ||+2 ||-3 +|1||2||3 +|1||+2||-3 |- | +1 | -1 @@ -6339,18 +6339,18 @@ Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present -1 - 1 - 2 - 3 +1 +2 +3 - 1 -+2 +1 ++2 -3 - +1 ++1 - -1 +-1 !!end @@ -6359,26 +6359,26 @@ Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present Table rowspan !! wikitext {| border=1 -| Cell 1, row 1 -|rowspan=2| Cell 2, row 1 (and 2) -| Cell 3, row 1 +|Cell 1, row 1 +|rowspan=2|Cell 2, row 1 (and 2) +|Cell 3, row 1 |- -| Cell 1, row 2 -| Cell 3, row 2 +|Cell 1, row 2 +|Cell 3, row 2 |} !! html - - - - -
    Cell 1, row 1 +Cell 1, row 1 Cell 2, row 1 (and 2) +Cell 2, row 1 (and 2) Cell 3, row 1 +Cell 3, row 1
    Cell 1, row 2 +Cell 1, row 2 Cell 3, row 2 +Cell 3, row 2
    !! end @@ -6399,7 +6399,7 @@ Nested table !! html - - +
    α +α @@ -6444,7 +6444,7 @@ Table cell attributes: Pipes protected by nowikis should be treated as a plain c -
    bar title="foo|" bar +title="foo|" bar
    !! html/parsoid @@ -6484,17 +6484,17 @@ parsoid=wt2html,html2html Element attributes with double ! should not be broken up by
    !! wikitext {| -! hi
    ha
    ho +!hi
    ha
    ho |} !! html/php -
    hi
    ha
    ho +
    hi
    ha
    ho
    !! html/parsoid - +
    hi
    ha
    ho
    hi
    ha
    ho
    !! end @@ -6502,17 +6502,17 @@ Element attributes with double ! should not be broken up by
    ! and || in element attributes should not be parsed as / !! wikitext {| -|
    hi
    +|
    hi
    |} !! html/php -
    hi
    +
    hi
    !! html/parsoid - +
    hi
    hi
    !! end @@ -6523,18 +6523,18 @@ Element attributes with double ! should not be broken up by
    parsoid=wt2html !! wikitext {| -| style="color: red !important;" data-contrived="put this here ||" | foo +|style="color: red !important;" data-contrived="put this here ||"|foo |} !! html/php - - +
    style="color: red !important;" data-contrived="put this here foo +style="color: red !important;" data-contrived="put this herefoo
    !! html/parsoid - +
    style="color: red !important;" data-contrived="put this here foo
    style="color: red !important;" data-contrived="put this herefoo
    !! end @@ -6580,22 +6580,22 @@ Invalid text in table attributes should be discarded parsoid=wt2html !! wikitext {| boo style='border:1px solid black' -| boo style='color:blue' | 1 -|boo style='color:blue'| 2 +| boo style='color:blue' |1 +|boo style='color:blue'|2 |} !! html/php - -
    1 +1 2 +2
    !! html/parsoid - - + +
    1 212
    !! end @@ -6640,7 +6640,7 @@ parsoid={
    Foo style="color:red;"style="color:red;" Bar Foo @@ -6754,14 +6754,14 @@ parsoid=wt2html,html2html {| |- -! foo +!foo |} !! html/* -
    foo +foo
    !! end @@ -6774,14 +6774,14 @@ parsoid=wt2html,html2html {| |- -| foo +|foo |} !! html/* -
    foo +foo
    !! end @@ -6792,17 +6792,17 @@ Table attributes with empty value parsoid=wt2html,html2html !! wikitext {| -| style=| hello +| style=|hello |} !! html/php -
    hello +hello
    !! html/parsoid - +
    hello
    hello
    !! end @@ -6811,7 +6811,7 @@ Wikitext table with a lot of comments !! wikitext {| -| foo +|foo |- @@ -6821,7 +6821,7 @@ Wikitext table with a lot of comments !! html -
    foo +foo
    @@ -6834,18 +6834,18 @@ Wikitext table comments represented in parsoid dom !! wikitext {| |- -| x +|x |} !! html/php+tidy -
    x +x
    !! html/parsoid - +
    x
    x
    !! end @@ -6871,14 +6871,14 @@ Table cell with a single comment !! wikitext {| | -| a +|a |} !! html -
    a +a
    !! end @@ -6889,21 +6889,21 @@ Table-cell after a comment-only-empty-line {| |a -| b +|b |} !! html -
    a b +b
    !! html/parsoid - +
    a b
    b
    !! end @@ -6912,21 +6912,21 @@ Table-cell after a comment-only-empty-line Build table with {{!}} !! wikitext {{{!}} class="wikitable" -! header -! second header +!header +!second header {{!}}- style="color:red;" -{{!}} data {{!}}{{!}} style="color:red;" {{!}} second data +{{!}}data{{!}}{{!}} style="color:red;" {{!}}second data {{!}}} !! html - - - - +
    header +header second header +second header
    data second data +datasecond data
    !! end @@ -6935,33 +6935,33 @@ Build table with {{!}} Build table with pipe as data !! wikitext {| class="wikitable" -! header -! second header +!header +!second header |- style="color:red;" -| data || style="color:red;" | second data +|data|| style="color:red;" |second data |- -| style="color:red;" | data with | || style="color:red;" | second data with | +| style="color:red;" |data with | || style="color:red;" | second data with | |- -|| data with | ||| second data with | +||data with | |||second data with | |} !! html - - - - + - - + - - +
    header +header second header +second header
    data second data +datasecond data
    data with | second data with | +data with |second data with |
    data with | second data with | +data with |second data with |
    !! end @@ -6970,25 +6970,25 @@ Build table with pipe as data Build table with wikilink !! wikitext {| class="wikitable" -! header || second header +!header||second header |- style="color:red;" -| data [[Main Page|linktext]] || second data [[Main Page|linktext]] +|data [[Main Page|linktext]]||second data [[Main Page|linktext]] |- -| data || second data [[Main Page|link|text with pipe]] +|data||second data [[Main Page|link|text with pipe]] |} !! html - - + - - + - - +
    header second header +headersecond header
    data linktext second data linktext +data linktextsecond data linktext
    data second data link|text with pipe +datasecond data link|text with pipe
    !! end @@ -7069,20 +7069,20 @@ Template generated table cell with attributes !! wikitext {| |- -{{table_attribs_4}} || a || b +{{table_attribs_4}} ||a||b |} !! html/php+tidy - - - + +
    a b +ab
    !! html/parsoid - + !! end !! test @@ -7147,17 +7147,17 @@ Parsoid: Row-syntax table headings followed by comment & table cells parsoid=wt2html,wt2wt !! wikitext {| -! foo || bar - || baz || quux +!foo||bar + ||baz||quux |} !! html/php
    a b
    ab
    - - + - - +
    foo bar +foobar baz quux +bazquux
    !! html/parsoid @@ -9251,9 +9251,9 @@ Redirect followed by block on the same line !! options parsoid=wt2html !! wikitext -#REDIRECT [[Main Page]]== hi == +#REDIRECT [[Main Page]]==hi== !! html/parsoid -

    hi

    +

    hi

    !! end !! test @@ -9480,11 +9480,11 @@ Horizontal ruler -- Supports content following dashes on same line Common list !! wikitext *Common list -* item 2 +*item 2 *item 3 !! html
    • Common list
    • -
    • item 2
    • +
    • item 2
    • item 3
    !! end @@ -9494,11 +9494,11 @@ Numbered list !! wikitext #Numbered list #item 2 -# item 3 +#item 3 !! html
    1. Numbered list
    2. item 2
    3. -
    4. item 3
    +
  • item 3
  • !! end @@ -9506,9 +9506,9 @@ Numbered list Mixed list !! wikitext *Mixed list -*# with numbers -** and bullets -*# and numbers +*#with numbers +**and bullets +*#and numbers *bullets again **bullet level 2 ***bullet level 3 @@ -9518,13 +9518,13 @@ Mixed list **#Number on level 3 *#number level 2 *Level 1 -*** Level 3 -#** Level 3, but ordered +***Level 3 +#**Level 3, but ordered !! html
    • Mixed list -
      1. with numbers
      -
      • and bullets
      -
      1. and numbers
    • +
      1. with numbers
      +
      • and bullets
      +
      1. and numbers
    • bullets again
      • bullet level 2
        • bullet level 3 @@ -9534,43 +9534,43 @@ Mixed list
        • Number on level 3
        1. number level 2
      • Level 1 -
          • Level 3
      -
          • Level 3, but ordered
      +
        • Level 3
    +
        • Level 3, but ordered
    !! end !! test 1. Nested mixed wikitext and html list !! wikitext -* hi -*
    • ho
    -* hi -** ho +*hi +*
    • ho
    +*hi +**ho !! html/php -
    • hi
    • -
      • ho
    • -
    • hi -
      • ho
    +
    • hi
    • +
      • ho
    • +
    • hi +
      • ho
    !! html/parsoid -
    • hi
    • -
      • ho
    • -
    • hi -
      • ho
    +
    • hi
    • +
      • ho
    • +
    • hi +
      • ho
    !! end !! test 2. Nested mixed wikitext and html list (incompatible) !! wikitext -; hi -: {{echo|
  • ho
  • }} +;hi +:{{echo|
  • ho
  • }} !! html/php -
    hi
    -
  • ho
  • +
    hi
    +
  • ho
  • !! html/parsoid -
    hi
    -
  • ho
  • +
    hi
    +
  • ho
  • !! end !! test @@ -9642,24 +9642,24 @@ Nested lists 6 (both elements empty) !! test Nested lists 7 (skip initial nesting levels) !! wikitext -*** foo +***foo !! html -
        • foo
    +
        • foo
    !! end !! test Nested lists 8 (multiple nesting transitions) !! wikitext -* foo -*** bar -** baz -* boo +*foo +***bar +**baz +*boo !! html -
    • foo -
        • bar
      • -
      • baz
    • -
    • boo
    +
    • foo +
        • bar
      • +
      • baz
    • +
    • boo
    !! end @@ -9700,60 +9700,61 @@ parsoid !! test List items are not parsed correctly following a
     block (T2785)
     !! wikitext
    -* 
    foo
    -*
    bar
    -* zar +*
    foo
    +*
    bar
    +*zar !! html/php -
    • foo
    • -
    • bar
    • -
    • zar
    +
    • foo
    • +
    • bar
    • +
    • zar
    !! html/parsoid -
    • foo
    • -
    • bar
    • -
    • zar
    +
    • foo
    • +
    • bar
    • +
    • zar
    !! end +# FIXME: Might benefit from a html/parsoid since this has a template !! test List items from template !! wikitext {{inner list}} -* item 2 +*item 2 -* item 0 +*item 0 {{inner list}} -* item 2 +*item 2 -* item 0 -* notSOL{{inner list}} -* item 2 +*item 0 +*notSOL{{inner list}} +*item 2 !! html -
    • item 1
    • -
    • item 2
    -
    • item 0
    • -
    • item 1
    • -
    • item 2
    -
    • item 0
    • -
    • notSOL
    • -
    • item 1
    • -
    • item 2
    +
    • item 1
    • +
    • item 2
    +
    • item 0
    • +
    • item 1
    • +
    • item 2
    +
    • item 0
    • +
    • notSOL
    • +
    • item 1
    • +
    • item 2
    !! end !! test List interrupted by empty line or heading !! wikitext -* foo +*foo -** bar -== A heading == -* Another list item +**bar +==A heading== +*Another list item !! html -
    • foo
    -
      • bar
    +
    • foo
    +
      • bar

    A heading[edit]

    -
    • Another list item
    +
    • Another list item
    !!end @@ -9821,29 +9822,29 @@ Test the li-hack (a hack from Tidy days, but doesn't work as advertised with Rem !!options parsoid=wt2html,wt2wt !! wikitext -* foo -*
  • li-hack -* {{echo|
  • templated li-hack}} -*
  • unsupported li-hack with preceding comments +*foo +*
  • li-hack +*{{echo|
  • templated li-hack}} +*
  • unsupported li-hack with preceding comments
    • not a li-hack
    !! html+tidy -
    • foo
    • -
    • li-hack
    • -
    • templated li-hack
    • -
    • unsupported li-hack with preceding comments
    +
    • foo
    • +
    • li-hack
    • +
    • templated li-hack
    • +
    • unsupported li-hack with preceding comments
    • not a li-hack
    !! html/parsoid
    • foo
    • -
    • li-hack
    • -
    • templated li-hack
    • -
    • unsupported li-hack with preceding comments
    +
  • li-hack
  • +
  • templated li-hack
  • +
  • unsupported li-hack with preceding comments
    • not a li-hack @@ -9857,24 +9858,24 @@ Parsoid: Make sure nested lists are serialized on their own line even if HTML co !! options parsoid !! wikitext -# foo -## bar -* foo -** bar -: foo -:: bar +#foo +##bar +*foo +**bar +:foo +::bar !! html
        -
      1. foo
          -
        1. bar
        2. +
        3. foo
            +
          1. bar
          -
        • foo
            -
          • bar
          • +
          • foo
              +
            • bar
          -
          foo
          -
          bar
          +
          foo
          +
          bar
          !! end @@ -9908,7 +9909,7 @@ Unbalanced closing block tags break a list
          • a
        • b
        • -!! html+parsoid +!! html/parsoid
          • a
          @@ -9944,14 +9945,14 @@ Unclosed formatting tags that straddle lists are closed and reopened !! options parsoid=wt2html,wt2wt,html2html !! wikitext -# a -# b +# a +#b !! html/php+tidy -
          1. a
          2. -
          3. b
          +
          1. a
          2. +
          3. b
          !! html/parsoid -
          1. a
          2. -
          3. b
          +
          1. a
          2. +
          3. b
          !! end # Output is ugly because of all the misnested tag fixups. @@ -9966,16 +9967,16 @@ parsoid=wt2html,wt2wt,html2html 1. List embedded in a formatting tag !! wikitext -* foo +*foo !! html/php+tidy

          -

          • foo

          +

          • foo

          !! html/parsoid
            -
          • foo
          • +
          • foo
          !!end @@ -10156,35 +10157,35 @@ Magic Word: {{CURRENTTIMESTAMP}} !! test Magic Words LOCAL (UTC) !! wikitext -* {{LOCALMONTH}} -* {{LOCALMONTH1}} -* {{LOCALMONTHNAME}} -* {{LOCALMONTHNAMEGEN}} -* {{LOCALMONTHABBREV}} -* {{LOCALDAY}} -* {{LOCALDAY2}} -* {{LOCALDAYNAME}} -* {{LOCALYEAR}} -* {{LOCALTIME}} -* {{LOCALHOUR}} -* {{LOCALWEEK}} -* {{LOCALDOW}} -* {{LOCALTIMESTAMP}} -!! html -
          • 01
          • -
          • 1
          • -
          • January
          • -
          • January
          • -
          • Jan
          • -
          • 1
          • -
          • 01
          • -
          • Thursday
          • -
          • 1970
          • -
          • 00:02
          • -
          • 00
          • -
          • 1
          • -
          • 4
          • -
          • 19700101000203
          +*{{LOCALMONTH}} +*{{LOCALMONTH1}} +*{{LOCALMONTHNAME}} +*{{LOCALMONTHNAMEGEN}} +*{{LOCALMONTHABBREV}} +*{{LOCALDAY}} +*{{LOCALDAY2}} +*{{LOCALDAYNAME}} +*{{LOCALYEAR}} +*{{LOCALTIME}} +*{{LOCALHOUR}} +*{{LOCALWEEK}} +*{{LOCALDOW}} +*{{LOCALTIMESTAMP}} +!! html +
          • 01
          • +
          • 1
          • +
          • January
          • +
          • January
          • +
          • Jan
          • +
          • 1
          • +
          • 01
          • +
          • Thursday
          • +
          • 1970
          • +
          • 00:02
          • +
          • 00
          • +
          • 1
          • +
          • 4
          • +
          • 19700101000203
          !! end @@ -11250,11 +11251,11 @@ Templates with templated name !! html

          foo

          -
          • item 1
          +
          • item 1
          !! html/parsoid

          foo

          -
          • item 1
          +
          • item 1
          !! end ## Regression test; the output here isn't really that interesting. @@ -11338,28 +11339,28 @@ T2553: link with two variables in a piped link Abort table cell attribute parsing on wikilink !! wikitext {| -| testing [[one|two]] | three || four -| testing one two | three || four -| testing="[[one|two]]" | three || four +|testing [[one|two]] |three||four +|testing one two |three||four +|testing="[[one|two]]" |three||four |} !! html/php - - + - - + - - +
          testing two | three four +testing two |threefour three four +threefour testing="two" | three four +testing="two" |threefour
          !! html/parsoid - - - + + +
          testing two | three four three four testing="two" | three four
          testing two |threefourthreefourtesting="two" |threefour
          !! end @@ -11367,11 +11368,11 @@ Abort table cell attribute parsing on wikilink Don't abort table cell attribute parsing if wikilink is found in template arg !! wikitext {| -| Test {{#tag:ref|One two "[[three]]" four}} +|Test {{#tag:ref|One two "[[three]]" four}} |} !! html/parsoid - +
          Test One two "three" four
          Test One two "three" four
          !! end @@ -11485,12 +11486,12 @@ foo {{table}}

          - - + - - +
          1 2 +12
          3 4 +34
          !! end @@ -11505,12 +11506,12 @@ foo

          - - + - - +
          1 2 +12
          3 4 +34
          !! end @@ -11828,32 +11829,32 @@ Includes and comments at SOL !! options parsoid=wt2html,html2html !! wikitext -== hu == +==hu== some -* stuff -* here +*stuff +*here -can have stuff=== here === +can have stuff===here=== !! html/php

          hu

          some

          -
          • stuff
          • -
          • here
          +
          • stuff
          • +
          • here

          here

          !! html/parsoid -

          hu

          +

          hu

          some

          -
          • stuff
          • -
          • here
          +
          • stuff
          • +
          • here
          -

          here

          +

          here

          !! end @@ -12072,10 +12073,10 @@ Preprocessor precedence 5: tplarg takes precedence over template !! wikitext {{Precedence5|Bullet}} !! html/php -
          • Bar
          +
          • Bar
          !! html/parsoid -
          • Bar
          +
          • Bar
          !! end !! test @@ -12165,14 +12166,14 @@ Preprocessor precedence 9: groups of braces {{Preprocessor precedence 9|Four|Bullet|1|2}} !! html/php
          4
          -
          {Four}
          +
          {Four}
          5
          -
          -
          • Bar
          +
          +
          • Bar
          6
          -
          Four
          +
          Four
          7
          -
          {Bullet}
          +
          {Bullet}
          !! html/parsoid
          @@ -12210,21 +12211,21 @@ language=zh {{Preprocessor precedence 10|Three|raw2|Bullet|1|2}} !! html/php
          1
          -
          raw
          +
          raw
          2
          -
          -
          -
          • Bar-
          +
          -
          +
          • Bar-
          3
          -
          -Three-
          +
          -Three-
          4
          -
          raw2
          +
          raw2
          5
          -
          -
          -
          • Bar-
          +
          -
          +
          • Bar-
          6
          -
          -Three-
          +
          -Three-
          7
          -
          raw2
          +
          raw2
          !! html/parsoid
          @@ -12278,14 +12279,14 @@ Preprocessor precedence 12: broken language converter closed by brace. parsoid=wt2html !! wikitext This form breaks the template, which is unfortunate: -* {{echo|foo-{bar}bat}} +*{{echo|foo-{bar}bat}} But if the broken language converter markup is inside an extension tag, nothing bad happens: -* foo-{bar}bat -* {{echo|foo-{bar}bat}} -*
          foo-{bar}bat
          -* {{echo|
          foo-{bar}bat
          }} +*foo-{bar}bat +*{{echo|foo-{bar}bat}} +*
          foo-{bar}bat
          +*{{echo|
          foo-{bar}bat
          }} foo-{bar}bat {{echo|foo-{bar}bat}} @@ -12293,14 +12294,14 @@ tag, nothing bad happens: !! html/php+tidy

          This form breaks the template, which is unfortunate:

          -
          • {{echo|foo-{bar}bat}}
          +
          • {{echo|foo-{bar}bat}}

          But if the broken language converter markup is inside an extension tag, nothing bad happens:

          -
          • foo-{bar}bat
          • -
          • foo-{bar}bat
          • -
          • foo-{bar}bat
          • -
          • foo-{bar}bat
          +
          • foo-{bar}bat
          • +
          • foo-{bar}bat
          • +
          • foo-{bar}bat
          • +
          • foo-{bar}bat
          'foo-{bar}bat'
           array (
           )
          @@ -12329,13 +12330,13 @@ Preprocessor precedence 13: broken language converter in external link
           !! options
           parsoid=wt2html
           !! wikitext
          -* [http://example.com/-{foo Example in URL]
          -* [http://example.com Example in -{link} description]
          -* {{echo|[http://example.com/-{foo Breaks template, however]}}
          +*[http://example.com/-{foo Example in URL]
          +*[http://example.com Example in -{link} description]
          +*{{echo|[http://example.com/-{foo Breaks template, however]}}
           !! html/php+tidy
          -
          +
           !! html/parsoid
           
          • Example in URL
          • @@ -12347,18 +12348,18 @@ parsoid=wt2html !! test Preprocessor precedence 14: broken language converter in comment !! wikitext -* ...should be ok -* ...extra dashes -* {{echo|foobat}} ...should be ok +*...should be ok +*...extra dashes +*{{echo|foobat}}...should be ok !! html/php+tidy -
            • ...should be ok
            • -
            • ...extra dashes
            • -
            • foobat ...should be ok
            +
            • ...should be ok
            • +
            • ...extra dashes
            • +
            • foobat...should be ok
            !! html/parsoid
              -
            • ...should be ok
            • -
            • ...extra dashes
            • -
            • foobat ...should be ok
            • +
            • ...should be ok
            • +
            • ...extra dashes
            • +
            • foobat...should be ok
            !! end @@ -12908,17 +12909,17 @@ Templates: Support for templates generating attributes and content 4. Entities and nowikis inside templated attributes should be handled correctly inside templated tables !! wikitext {| -| {{table_attribs_6}} hi +|{{table_attribs_6}} hi |} !! html/php -
            hi +hi
            !! html/parsoid - +
            hi
            hi
            !! end @@ -15156,6 +15157,10 @@ Image: caption containing leading space
            bar
            !!end +# html/php output not have newlines after table, td, th, etc. because +# Linker::makeThumbLink2() replaces the newlines with spaces since +# the table is inside a caption. +# FIXME: Verify if that circa 2004 fix is still required. !! test Image: caption containing a table !! options @@ -15163,21 +15168,21 @@ parsoid=wt2html,wt2wt,html2html !! wikitext [[Image:Foobar.jpg|thumb|200px|This is an example image thumbnail caption with a table {| -! Foo !! Bar +!Foo!!Bar |- -| Foo1 || Bar1 +|Foo1||Bar1 |} and some more text.]] !! html/php -
            This is an example image thumbnail caption with a table
            Foo Bar
            Foo1 Bar1
            and some more text.
            +
            This is an example image thumbnail caption with a table
            Foo Bar
            Foo1 Bar1
            and some more text.
            !! html/parsoid
            This is an example image thumbnail caption with a table - + - +
            Foo Bar
            FooBar
            Foo1 Foo1 Bar1
            and some more text.
            !! end @@ -16287,7 +16292,7 @@ es:1 fr:1 !! test Basic section headings !! wikitext -== Headline 1 == +==Headline 1== Some text ==Headline 2== @@ -16309,12 +16314,12 @@ Blah blah !! test Section headings with TOC !! wikitext -== Headline 1 == -=== Subheadline 1 === -===== Skipping a level ===== -====== Skipping a level ====== +==Headline 1== +===Subheadline 1=== +=====Skipping a level===== +======Skipping a level====== -== Headline 2 == +==Headline 2== Some text ===Another headline=== !! html @@ -16356,10 +16361,10 @@ Some text TOC anchors don't collide !! wikitext __FORCETOC__ -== Headline 2 == -== Headline == -== Headline 2 == -== Headline == +==Headline 2== +==Headline== +==Headline 2== +==Headline== !! html/php

            Contents

              @@ -16384,16 +16389,16 @@ Handling of sections up to level 6 and beyond !! options parsoid=wt2html !! wikitext -= Level 1 Heading= -== Level 2 Heading== -=== Level 3 Heading=== -==== Level 4 Heading==== -===== Level 5 Heading===== -====== Level 6 Heading====== -======= Level 7 Heading======= -======== Level 8 Heading======== -========= Level 9 Heading========= -========== Level 10 Heading========== +=Level 1 Heading= +==Level 2 Heading== +===Level 3 Heading=== +====Level 4 Heading==== +=====Level 5 Heading===== +======Level 6 Heading====== +=======Level 7 Heading======= +========Level 8 Heading======== +=========Level 9 Heading========= +==========Level 10 Heading========== !! html/php

              Contents

              @@ -16431,33 +16436,33 @@ parsoid=wt2html

              Level 4 Heading[edit]

              Level 5 Heading[edit]
              Level 6 Heading[edit]
              -
              = Level 7 Heading=[edit]
              -
              == Level 8 Heading==[edit]
              -
              === Level 9 Heading===[edit]
              -
              ==== Level 10 Heading====[edit]
              +
              =Level 7 Heading=[edit]
              +
              ==Level 8 Heading==[edit]
              +
              ===Level 9 Heading===[edit]
              +
              ====Level 10 Heading====[edit]
              !! html/parsoid -

              Level 1 Heading

              -

              Level 2 Heading

              -

              Level 3 Heading

              -

              Level 4 Heading

              -
              Level 5 Heading
              -
              Level 6 Heading
              -
              = Level 7 Heading=
              -
              == Level 8 Heading==
              -
              === Level 9 Heading===
              -
              ==== Level 10 Heading====
              +

              Level 1 Heading

              +

              Level 2 Heading

              +

              Level 3 Heading

              +

              Level 4 Heading

              +
              Level 5 Heading
              +
              Level 6 Heading
              +
              =Level 7 Heading=
              +
              ==Level 8 Heading==
              +
              ===Level 9 Heading===
              +
              ====Level 10 Heading====
              !! end !! test TOC regression (T11764) !! wikitext -== title 1 == -=== title 1.1 === -==== title 1.1.1 ==== -=== title 1.2 === -== title 2 == -=== title 2.1 === +==title 1== +===title 1.1=== +====title 1.1.1==== +===title 1.2=== +==title 2== +===title 2.1=== !! html

              Contents

                @@ -16509,12 +16514,12 @@ TOC with wgMaxTocLevel=3 (T8204) !! options wgMaxTocLevel=3 !! wikitext -== title 1 == -=== title 1.1 === -==== title 1.1.1 ==== -=== title 1.2 === -== title 2 == -=== title 2.1 === +==title 1== +===title 1.1=== +====title 1.1.1==== +===title 1.2=== +==title 2== +===title 2.1=== !! html

                Contents

                  @@ -16575,8 +16580,8 @@ wgMaxTocLevel=3 !! test Resolving duplicate section names !! wikitext -== Foo bar == -== Foo bar == +==Foo bar== +==Foo bar== !! html

                  Foo bar[edit]

                  Foo bar[edit]

                  @@ -16586,8 +16591,8 @@ Resolving duplicate section names !! test Resolving duplicate section names with differing case (T12721) !! wikitext -== Foo bar == -== Foo Bar == +==Foo bar== +==Foo Bar== !! html

                  Foo bar[edit]

                  Foo Bar[edit]

                  @@ -16641,9 +16646,9 @@ Link inside a section heading TOC regression (T14077) !! wikitext __TOC__ -== title 1 == -=== title 1.1 === -== title 2 == +==title 1== +===title 1.1=== +==title 2== !! html

                  Contents

                    @@ -16704,19 +16709,19 @@ Header with special characters (T27462) !! wikitext The tooltips shall not show entities to the user (ie. be double escaped) -== text > text == +==text > text== section 1 -== text < text == +==text < text== section 2 -== text & text == +==text & text== section 3 -== text ' text == +==text ' text== section 4 -== text " text == +==text " text== section 5 !! html/php

                    The tooltips shall not show entities to the user (ie. be double escaped) @@ -16749,19 +16754,19 @@ section 5 !! html/parsoid

                    The tooltips shall not show entities to the user (ie. be double escaped)

                    -

                    text > text

                    +

                    text > text

                    section 1

                    -

                    text < text

                    +

                    text < text

                    section 2

                    -

                    text & text

                    +

                    text & text

                    section 3

                    -

                    text ' text

                    +

                    text ' text

                    section 4

                    -

                    text " text

                    +

                    text " text

                    section 5

                    !! end @@ -16770,22 +16775,22 @@ Header with space, plus and underscore as entity !! wikitext Id should not contain + for spaces -== Space between Text == +==Space between Text== section 1 -== Space-Entity between Text == +==Space-Entity between Text== section 2 -== Plus+between+Text == +==Plus+between+Text== section 3 -== Plus-Entity+between+Text == +==Plus-Entity+between+Text== section 4 -== Underscore_between_Text == +==Underscore_between_Text== section 5 -== Underscore-Entity_between_Text == +==Underscore-Entity_between_Text== section 6 [[#Space between Text]] @@ -16835,22 +16840,22 @@ section 6 !! html/parsoid

                    Id should not contain + for spaces

                    -

                    Space between Text

                    +

                    Space between Text

                    section 1

                    -

                    Space-Entity between Text

                    +

                    Space-Entity between Text

                    section 2

                    -

                    Plus+between+Text

                    +

                    Plus+between+Text

                    section 3

                    -

                    Plus-Entity+between+Text

                    +

                    Plus-Entity+between+Text

                    section 4

                    -

                    Underscore_between_Text

                    +

                    Underscore_between_Text

                    section 5

                    -

                    Underscore-Entity_between_Text

                    +

                    Underscore-Entity_between_Text

                    section 6

                    #Space between Text @@ -16899,13 +16904,13 @@ HTML headers vs TOC (T25393) (__NOEDITSECTION__ for clearer output, doesn't matter here) !! wikitext

                    Header 1

                    -== Header 1.1 == -== Header 1.2 == +==Header 1.1== +==Header 1.2==

                    Header 2

                    -== Header 2.1 == -== Header 2.2 == +==Header 2.1== +==Header 2.2== __NOEDITSECTION__ !! html/php

                    Contents

                    @@ -16934,13 +16939,13 @@ __NOEDITSECTION__ !! html/parsoid

                    Header 1

                    -

                    Header 1.1

                    -

                    Header 1.2

                    +

                    Header 1.1

                    +

                    Header 1.2

                    Header 2

                    -

                    Header 2.1

                    -

                    Header 2.2

                    +

                    Header 2.1

                    +

                    Header 2.2

                    !! end @@ -17104,17 +17109,17 @@ table with multiple empty attribute values parsoid=wt2html,html2html !! wikitext {| title= id= -| hi +|hi |} !! html/php -
                    hi +hi
                    !! html/parsoid - +
                    hi
                    hi
                    !! end @@ -17155,12 +17160,12 @@ HTML multiple attributes correction Table multiple attributes correction !! wikitext {| -!+ class="error" class="awesome"| status +!+ class="error" class="awesome"|status |} !! html -
                    status +status
                    !!end @@ -17912,12 +17917,12 @@ MSIE 6 CSS safety test: Repetition markers (T57332) Table attribute legitimate extension !! wikitext {| -!+ style="color:blue"| status +!+ style="color:blue"|status |} !! html -
                    status +status
                    !!end @@ -17926,12 +17931,12 @@ Table attribute legitimate extension Table attribute safety !! wikitext {| -!+ style="border-width:expression(0+alert(document.cookie))"| status +!+ style="border-width:expression(0+alert(document.cookie))"|status |} !! html -
                    status +status
                    !! end @@ -18809,7 +18814,7 @@ Fuzz testing: Parser13 !! test Fuzz testing: Parser14 !! wikitext -== onmouseover= == +==onmouseover=== http://__TOC__ !! html/php

                    onmouseover=[edit]

                    @@ -18828,7 +18833,7 @@ http://

                    <
                  !! html/parsoid -

                  onmouseover=

                  +

                  onmouseover=

                  http://__TOC__

                  !! end @@ -18880,12 +18885,12 @@ Fuzz testing: Parser16 Fuzz testing: Parser21 !! wikitext {| -! irc://{{ftp://a" onmouseover="alert('hello world');" +!irc://{{ftp://a" onmouseover="alert('hello world');" | !! html - @@ -20056,23 +20061,23 @@ xxx !! test Handling of in URLs !! wikitext -** irc:// a +*irc:// a !! html/php - + !! html/parsoid - + !! end !! test Handling of %0A in URLs !! wikitext -** irc://%0Aa +*irc://%0Aa !! html/php - + !! html/parsoid - + !! end # The PHP parser strips the empty tags out for giggles; parsoid doesn't. @@ -20142,51 +20147,51 @@ Say the magic word !! options title=[[Parser test]] !! wikitext -* {{PAGENAME}} -* {{PAGENAMEE}} -* {{FULLPAGENAME}} -* {{FULLPAGENAMEE}} -* {{BASEPAGENAME}} -* {{BASEPAGENAMEE}} -* {{SUBPAGENAME}} -* {{SUBPAGENAMEE}} -* {{ROOTPAGENAME}} -* {{ROOTPAGENAMEE}} -* {{TALKPAGENAME}} -* {{TALKPAGENAMEE}} -* {{SUBJECTPAGENAME}} -* {{SUBJECTPAGENAMEE}} -* {{NAMESPACEE}} -* {{NAMESPACE}} -* {{NAMESPACENUMBER}} -* {{TALKSPACE}} -* {{TALKSPACEE}} -* {{SUBJECTSPACE}} -* {{SUBJECTSPACEE}} -* {{Dynamic|{{NUMBEROFUSERS}}|{{NUMBEROFPAGES}}|{{CURRENTVERSION}}|{{CONTENTLANGUAGE}}|{{DIRECTIONMARK}}|{{CURRENTTIMESTAMP}}|{{NUMBEROFARTICLES}}}} -!! html -
                  • Parser test
                  • -
                  • Parser_test
                  • -
                  • Parser test
                  • -
                  • Parser_test
                  • -
                  • Parser test
                  • -
                  • Parser_test
                  • -
                  • Parser test
                  • -
                  • Parser_test
                  • -
                  • Parser test
                  • -
                  • Parser_test
                  • -
                  • Talk:Parser test
                  • -
                  • Talk:Parser_test
                  • -
                  • Parser test
                  • -
                  • Parser_test
                  • -
                  • -
                  • -
                  • 0
                  • -
                  • Talk
                  • -
                  • Talk
                  • -
                  • -
                  • -
                  • Template:Dynamic
                  +*{{PAGENAME}} +*{{PAGENAMEE}} +*{{FULLPAGENAME}} +*{{FULLPAGENAMEE}} +*{{BASEPAGENAME}} +*{{BASEPAGENAMEE}} +*{{SUBPAGENAME}} +*{{SUBPAGENAMEE}} +*{{ROOTPAGENAME}} +*{{ROOTPAGENAMEE}} +*{{TALKPAGENAME}} +*{{TALKPAGENAMEE}} +*{{SUBJECTPAGENAME}} +*{{SUBJECTPAGENAMEE}} +*{{NAMESPACEE}} +*{{NAMESPACE}} +*{{NAMESPACENUMBER}} +*{{TALKSPACE}} +*{{TALKSPACEE}} +*{{SUBJECTSPACE}} +*{{SUBJECTSPACEE}} +*{{Dynamic|{{NUMBEROFUSERS}}|{{NUMBEROFPAGES}}|{{CURRENTVERSION}}|{{CONTENTLANGUAGE}}|{{DIRECTIONMARK}}|{{CURRENTTIMESTAMP}}|{{NUMBEROFARTICLES}}}} +!! html +
                  • Parser test
                  • +
                  • Parser_test
                  • +
                  • Parser test
                  • +
                  • Parser_test
                  • +
                  • Parser test
                  • +
                  • Parser_test
                  • +
                  • Parser test
                  • +
                  • Parser_test
                  • +
                  • Parser test
                  • +
                  • Parser_test
                  • +
                  • Talk:Parser test
                  • +
                  • Talk:Parser_test
                  • +
                  • Parser test
                  • +
                  • Parser_test
                  • +
                  • +
                  • +
                  • 0
                  • +
                  • Talk
                  • +
                  • Talk
                  • +
                  • +
                  • +
                  • Template:Dynamic
                  !! end ### Note: Above tests excludes the "{{NUMBEROFADMINS}}" magic word because it generates a MySQL error when included. @@ -20902,20 +20907,20 @@ Illegal character references (T106578) ; Surrogate: �� ; This is an okay astral character: 💩 !! html+tidy -
                  Null
                  -
                  &#00;
                  -
                  FF
                  -
                  &#xC;
                  -
                  CR
                  -
                  &#xD;
                  -
                  Control (low)
                  -
                  &#8;
                  -
                  Control (high)
                  -
                  &#x7F; &#x9F;
                  -
                  Surrogate
                  -
                  &#xD83D;&#xDCA9;
                  -
                  This is an okay astral character
                  -
                  💩
                  +
                  Null
                  +
                  &#00;
                  +
                  FF
                  +
                  &#xC;
                  +
                  CR
                  +
                  &#xD;
                  +
                  Control (low)
                  +
                  &#8;
                  +
                  Control (high)
                  +
                  &#x7F; &#x9F;
                  +
                  Surrogate
                  +
                  &#xD83D;&#xDCA9;
                  +
                  This is an okay astral character
                  +
                  💩
                  !! end !! test @@ -21279,20 +21284,20 @@ parsoid=wt2html !! test Definition list code coverage !! wikitext -; title : def -; title : def +;title : def +;title : def ;title: def !! html/php -
                  title  
                  -
                  def
                  -
                  title 
                  -
                  def
                  +
                  title  
                  +
                  def
                  +
                  title 
                  +
                  def
                  title
                  -
                  def
                  +
                  def
                  !! html/parsoid -
                  title  
                  def
                  -
                  title 
                  def
                  +
                  title  
                  def
                  +
                  title 
                  def
                  title
                  def
                  !! end @@ -21537,7 +21542,7 @@ anchorencode encodes like the TOC generator: (T20431) !! config wgFragmentMode=[ 'html5', 'legacy' ] !! wikitext -=== _ +:.3A%3A _ &&]] x === +===_ +:.3A%3A _ &&]] x=== {{anchorencode: _ +:.3A%3A _ &&]] x}} __NOEDITSECTION__ !! html/php @@ -21545,7 +21550,7 @@ __NOEDITSECTION__

                  +:.3A%3A_&&]]_x

                  !! html/parsoid -

                  _ +:.3A%3A _ &&]] x

                  +

                  _ +:.3A%3A _ &&]] x

                  +:.3A%3A_&&]]_x

                  !! end @@ -21555,7 +21560,7 @@ anchorencode encodes like the TOC generator: (T20431) (legacy) !! config wgFragmentMode=[ 'legacy' ] !! wikitext -=== _ +:.3A%3A&&]] === +===_ +:.3A%3A&&]]=== {{anchorencode: _ +:.3A%3A&&]] }} __NOEDITSECTION__ !! html/php @@ -21839,12 +21844,12 @@ wgFragmentMode=[ 'html5', 'legacy' ] !! options language=sr variant=sr-ec !! wikitext -== -{Naslov}- == +==-{Naslov}-== Note that even an unprotected headline ID is not affected by language conversion: -== Latinski == +==Latinski== !! html/php

                  Naslov[уреди]

                  Ноте тхат евен ан унпротецтед хеадлине ИД ис нот аффецтед бy лангуаге @@ -21853,7 +21858,7 @@ conversion:

                  Латински[уреди]

                  !! html/parsoid -

                  +

                  Note that even an unprotected headline ID is not affected by language conversion:

                  @@ -22740,7 +22745,7 @@ parsoid=wt2html,wt2wt,html2html
                  irc://{{ftp://a" onmouseover="alert('hello world');" +irc://{{ftp://a" onmouseover="alert('hello world');"
                  -
                  B +B
                  !! html/parsoid @@ -22871,20 +22876,20 @@ language=sr !! test T2529: Uncovered bullet !! wikitext -* Foo {{bullet}} +*Foo {{bullet}} !! html -
                  • Foo
                  • -
                  • Bar
                  +
                  • Foo
                  • +
                  • Bar
                  !! end !! test T2529: Uncovered bullet in a deeply nested list !! wikitext -******* Foo {{bullet}} +*******Foo {{bullet}} !! html -
                              • Foo
                  • -
                  • Bar
                  +
                              • Foo
                  • +
                  • Bar
                  !! end @@ -22900,12 +22905,12 @@ y

                  - - + - - +
                  1 2 +12
                  3 4 +34

                  y

                  @@ -22914,10 +22919,10 @@ y !! test T2529: Uncovered bullet in parser function result !! wikitext -* Foo {{lc:{{bullet}} }} +*Foo {{lc:{{bullet}} }} !! html -
                  • Foo
                  • -
                  • bar
                  +
                  • Foo
                  • +
                  • bar
                  !! end @@ -23708,13 +23713,13 @@ showindicators [[Main Page]] [[File:Foobar.jpg|25px|link=]] [[File:Foobar.jpg|25px]] -* foo -* bar +*foo +*bar foo Preformatted
                  Broken tag {| class=wikitable -| cell +|cell |} Two @@ -23724,8 +23729,8 @@ paragraphs 02=Main Page 03=Foobar.jpg 04=Foobar.jpg -05=
                  • foo
                  • -
                  • bar
                  +05=
                  • foo
                  • +
                  • bar
                  06=foo 07=
                  Preformatted
                  @@ -23734,7 +23739,7 @@ paragraphs
                   
                   09=
                  -
                  cell +cell
                  10=

                  Two @@ -24001,7 +24006,7 @@ T28375: TOC with italics title=[[Main Page]] !! wikitext __TOC__ -== ''Lost'' episodes == +==''Lost'' episodes== !! html/php

                  Contents

                    @@ -24013,7 +24018,7 @@ __TOC__ !! html/parsoid -

                    Lost episodes

                    +

                    Lost episodes

                    !! end !! test @@ -24022,7 +24027,7 @@ T28375: TOC with bold title=[[Main Page]] !! wikitext __TOC__ -== '''should be bold''' then normal text == +=='''should be bold''' then normal text== !! html/php

                    Contents

                      @@ -24034,7 +24039,7 @@ __TOC__ !! html/parsoid -

                      should be bold then normal text

                      +

                      should be bold then normal text

                      !! end !! test @@ -24043,7 +24048,7 @@ T35845: Headings become cursive in TOC when they contain an image title=[[Main Page]] !! wikitext __TOC__ -== Image [[Image:foobar.jpg]] == +==Image [[Image:foobar.jpg]]== !! html/php

                      Contents

                        @@ -24055,7 +24060,7 @@ __TOC__ !! html/parsoid -

                        Image

                        +

                        Image

                        !! end !! test @@ -24064,7 +24069,7 @@ T35845 (2): Headings become bold in TOC when they contain a blockquote title=[[Main Page]] !! wikitext __TOC__ -==
                        Quote
                        == +==
                        Quote
                        == !! html/php

                        Contents

                          @@ -24084,7 +24089,7 @@ __TOC__

                          Quote

                          [edit]

                          !! html/parsoid -

                          Quote

                          +

                          Quote

                          !! end !! test @@ -24095,7 +24100,7 @@ wgFragmentMode=[ 'html5', 'legacy' ] title=[[Main Page]] !! wikitext __TOC__ -== Proof: 2 < 3 == +==Proof: 2 < 3== Hanc marginis exiguitas non caperet. QED !! html/php @@ -24111,7 +24116,7 @@ QED

                          !! html/parsoid -

                          Proof: 2 < 3

                          +

                          Proof: 2 < 3

                          Hanc marginis exiguitas non caperet. QED

                          !! end @@ -24120,9 +24125,9 @@ QED

                          Multiple tags in TOC !! wikitext __TOC__ -== Foo Bar == +==Foo Bar== -== Foo
                          Bar
                          == +==Foo
                          Bar
                          == !! html/php

                          Contents

                            @@ -24146,9 +24151,9 @@ __TOC__

                            Foo

                            Bar

                            [edit]

                            !! html/parsoid -

                            Foo Bar

                            +

                            Foo Bar

                            -

                            Foo
                            Bar

                            +

                            Foo
                            Bar

                            !! end # Don't expect Parsoid to roundtrip this until the php parser comes closer to @@ -24159,9 +24164,9 @@ Tags with parameters in TOC parsoid=wt2html !! wikitext __TOC__ -== Hello == +==Hello== -== Evilbye == +==Evilbye== !! html/php

                            Contents

                              @@ -24175,24 +24180,24 @@ __TOC__ !! html/parsoid -

                              Hello

                              +

                              Hello

                              -

                              b">Evilbye

                              +

                              b">Evilbye

                              !! end !! test span tags with directionality in TOC !! wikitext __TOC__ -== C++ == +==C++== -== זבנג! == +==זבנג!== -== The attributes on these span tags must be deleted from the TOC == +==The attributes on these span tags must be deleted from the TOC== -== All attributes on these span tags must be deleted from the TOC == +==All attributes on these span tags must be deleted from the TOC== -== Attributes after dir on these span tags must be deleted from the TOC == +==Attributes after dir on these span tags must be deleted from the TOC== !! html/php

                              Contents

                                @@ -24212,18 +24217,18 @@ __TOC__ !! html/parsoid -

                                C++

                                -

                                זבנג!

                                -

                                The attributes on these span tags must be deleted from the TOC

                                -

                                All attributes on these span tags must be deleted from the TOC

                                -

                                Attributes after dir on these span tags must be deleted from the TOC

                                +

                                C++

                                +

                                זבנג!

                                +

                                The attributes on these span tags must be deleted from the TOC

                                +

                                All attributes on these span tags must be deleted from the TOC

                                +

                                Attributes after dir on these span tags must be deleted from the TOC

                                !! end !! test T74884: bdi element in ToC !! wikitext __TOC__ -== test == +==test== !! html/php

                                Contents

                                  @@ -24235,14 +24240,14 @@ __TOC__ !! html/parsoid -

                                  test

                                  +

                                  test

                                  !! end !! test T35715: s/strike element in ToC !! wikitext __TOC__ -== test test test == +==test test test== !! html/php

                                  Contents

                                    @@ -24254,14 +24259,14 @@ __TOC__ !! html/parsoid -

                                    test test test

                                    +

                                    test test test

                                    !! end !! test Empty

                                    tag in TOC, removed by Sanitizer (T92892) !! wikitext __TOC__ -== x == +==x== !! html/php

                                    Contents

                                      @@ -24273,7 +24278,7 @@ __TOC__ !! html/parsoid -

                                      x

                                      +

                                      x

                                      !! end !! article @@ -24425,17 +24430,17 @@ new support for bdi element (T33817) Ignore pipe between table row attributes !! wikitext {| -| quux +|quux |- id=foo | style='color: red' -| bar +|bar |} !! html - -
                                      quux +quux
                                      bar +bar
                                      !! end @@ -24541,11 +24546,11 @@ Disable TOC notoc !! wikitext Lead -== Section 1 == -== Section 2 == -== Section 3 == -== Section 4 == -== Section 5 == +==Section 1== +==Section 2== +==Section 3== +==Section 4== +==Section 5== !! html

                                      Lead

                                      @@ -25670,9 +25675,9 @@ parsoid=html2wt !! html/php - -
                                      <foo +<foo bar> +bar>
                                      !! end @@ -26562,12 +26567,12 @@ parsoid=wt2html,html2html Accept empty td cell attribute !! wikitext {| -| align="center" | foo || | +| align="center" |foo|| | |} !! html - +
                                      foo foo
                                      @@ -26577,13 +26582,13 @@ Accept empty td cell attribute Non-empty attributes in th-cells !! wikitext {| -! Foo !! style="color: red" | Bar +!Foo!! style="color: red" |Bar |} !! html - - +
                                      Foo Bar +FooBar
                                      !!end @@ -26592,13 +26597,13 @@ Non-empty attributes in th-cells Accept empty attributes in th-cells !! wikitext {| -!| foo !!| bar +!|foo!!|bar |} !! html - - +
                                      foo bar +foobar
                                      !!end @@ -26607,17 +26612,17 @@ Accept empty attributes in th-cells Empty table rows go away !! wikitext {| -| Hello -| there +|Hello +|there |- class="foo" |- |} !! html - -
                                      Hello +Hello there +there
                                      @@ -26759,13 +26764,13 @@ Indent and comment before table row !! wikitext {| |- - | there + |there |} !! html/php -
                                      there +there
                                      !! html/parsoid @@ -29563,15 +29568,15 @@ parsoid={ !! test Empty LI (T49673) !! wikitext -* a +*a * * -* b +*b !! html+tidy -
                                      • a
                                      • -
                                      • +
                                        • a
                                        • +
                                        • -
                                        • b
                                        +
                                      • b
                                      !! end !! test @@ -29696,14 +29701,14 @@ Decoding of HTML entities in headings and links for IDs and link fragments (T103 !! config wgFragmentMode=[ 'html5', 'legacy' ] !! wikitext -== A&B&C&amp;D&amp;amp;E == +==A&B&C&amp;D&amp;amp;E== [[#A&B&C&amp;D&amp;amp;E]] !! html/php

                                      A&B&C&amp;D&amp;amp;E[edit]

                                      #A&B&C&amp;D&amp;amp;E

                                      !! html/parsoid -

                                      A&B&C&amp;D&amp;amp;E

                                      +

                                      A&B&C&amp;D&amp;amp;E

                                      #A&B&C&amp;D&amp;amp;E

                                      !! end @@ -29712,7 +29717,7 @@ Decoding of HTML entities in headings and links for IDs and link fragments (T103 !! config wgFragmentMode=[ 'legacy' ] !! wikitext -== A&B&C&amp;D&amp;amp;E == +==A&B&C&amp;D&amp;amp;E== [[#A&B&C&amp;D&amp;amp;E]] !! html/php

                                      A&B&C&amp;D&amp;amp;E[edit]

                                      @@ -29765,17 +29770,17 @@ HTML5 ids: fallback to legacy !! config wgFragmentMode=[ 'html5', 'legacy' ] !! wikitext -== Foo bar == +==Foo bar== -== foo Bar == +==foo Bar== -== Тест == +==Тест== -== Тест == +==Тест== -== тест == +==тест== -== Hey < # " > % : ' == +==Hey < # " > % : '== [[#Foo bar]] [[#foo Bar]] [[#Тест]] [[#тест]] [[#Hey < # " > % : ']] {{anchorencode:💩}} @@ -29806,20 +29811,20 @@ wgFragmentMode=[ 'html5', 'legacy' ]

                                      #啤酒 #啤酒

                                      !! html/parsoid -

                                      Foo bar

                                      +

                                      Foo bar

                                      -

                                      foo Bar

                                      +

                                      foo Bar

                                      -

                                      Тест

                                      +

                                      Тест

                                      -

                                      Тест

                                      +

                                      Тест

                                      -

                                      тест

                                      +

                                      тест

                                      -

                                      Hey < # " > % : '

                                      +

                                      Hey < # " > % : '

                                      #Foo bar #foo Bar #Тест #тест #Hey < # " > % : '

                                      -

                                      💩

                                      +

                                      💩

                                      #啤酒 #啤酒

                                      @@ -29831,17 +29836,17 @@ HTML5 ids: legacy with a fallback to modern !! config wgFragmentMode=[ 'legacy', 'html5' ] !! wikitext -== Foo bar == +==Foo bar== -== foo Bar == +==foo Bar== -== Тест == +==Тест== -== Тест == +==Тест== -== тест == +==тест== -== Hey < # " > % : ' == +==Hey < # " > % : '== [[#Foo bar]] [[#foo Bar]] [[#Тест]] [[#тест]] [[#Hey < # " > % : ']] {{anchorencode:💩}} @@ -29879,17 +29884,17 @@ HTML5 ids: no legacy !! config wgFragmentMode=[ 'html5' ] !! wikitext -== Foo bar == +==Foo bar== -== foo Bar == +==foo Bar== -== Тест == +==Тест== -== Тест == +==Тест== -== тест == +==тест== -== Hey < # " > % : ' == +==Hey < # " > % : '== [[#Foo bar]] [[#foo Bar]] [[#Тест]] [[#тест]] [[#Hey < # " > % : ']] {{anchorencode:💩}} @@ -29926,7 +29931,7 @@ T90902: Normalize weird characters in section IDs !! config wgFragmentMode=[ 'html5', 'legacy' ] !! wikitext -== Foo bar == +==Foo bar== [[#Foo bar]] !! html/php @@ -29988,40 +29993,40 @@ parsoid={ "wrapSections": true } !! wikitext -= 1 = +=1= a -= 2 = +=2= b -== 2.1 == +==2.1== c -== 2.2 == +==2.2== d -=== 2.2.1 === +===2.2.1=== e -= 3 = +=3= f !! html/parsoid -

                                      1

                                      +

                                      1

                                      a

                                      -

                                      2

                                      +

                                      2

                                      b

                                      -

                                      2.1

                                      +

                                      2.1

                                      c

                                      -

                                      2.2

                                      +

                                      2.2

                                      d

                                      -

                                      2.2.1

                                      +

                                      2.2.1

                                      e

                                      -

                                      3

                                      +

                                      3

                                      f

                                      @@ -30040,13 +30045,13 @@ Para 2 with a
                                      nested in it
                                      Para 3. -= 1 = +=1= a -= 2 = +=2= b -== 2.1 == +==2.1== c !! html/parsoid

                                      Para 1.

                                      @@ -30055,13 +30060,13 @@ c

                                      Para 3.

                                      -

                                      1

                                      +

                                      1

                                      a

                                      -

                                      2

                                      +

                                      2

                                      b

                                      -

                                      2.1

                                      +

                                      2.1

                                      c

                                      @@ -30074,29 +30079,29 @@ parsoid={ "wrapSections": true } !! wikitext -= 1 = +=1= a {{echo|1= -== 1.1 == +==1.1== b }} -== 1.2 == +==1.2== c -= 2 = +=2= d !! html/parsoid -

                                      1

                                      +

                                      1

                                      a

                                      -

                                      1.1

                                      +

                                      1.1

                                      b

                                      -

                                      1.2

                                      +

                                      1.2

                                      c

                                      -

                                      2

                                      +

                                      2

                                      d

                                      !! end @@ -30110,26 +30115,26 @@ parsoid={ "modes": ["wt2html", "wt2wt"] } !! wikitext -= 1 = +=1= a {{echo|1= -== 1.1 == +==1.1== b -=== 1.1.1 === +===1.1.1=== d }} -= 2 = +=2= e !! html/parsoid -

                                      1

                                      +

                                      1

                                      a

                                      -

                                      1.1

                                      +

                                      1.1

                                      b

                                      -

                                      1.1.1

                                      +

                                      1.1.1

                                      d

                                      -

                                      2

                                      +

                                      2

                                      e

                                      !! end @@ -30143,32 +30148,32 @@ parsoid={ "modes": ["wt2html", "wt2wt"] } !! wikitext -= 1 = +=1= a {{echo|1= x -== 1.1 == +==1.1== b ==1.2== c ===1.2.1=== d }} -= 2 = +=2= e !! html/parsoid

                                      1

                                      a

                                      -

                                      x

                                      -

                                      1.1

                                      +

                                      x

                                      +

                                      1.1

                                      b

                                      1.2

                                      c

                                      1.2.1

                                      d

                                      -

                                      2

                                      +

                                      2

                                      e

                                      !! end @@ -30187,7 +30192,7 @@ parsoid={ a {{echo| -= 1 = +=1= b }} @@ -30197,8 +30202,8 @@ c

                                      a

                                      - -

                                      1

                                      + +

                                      1

                                      b

                                      @@ -30217,32 +30222,32 @@ parsoid={ "wrapSections": true } !! wikitext -= 1 = +=1= a {{echo|1= -= 2 = +=2= b -== 2.1 == +==2.1== c }} d -= 3 = +=3= e !! html/parsoid -

                                      1

                                      +

                                      1

                                      a

                                      -

                                      2

                                      +

                                      2

                                      b

                                      -

                                      2.1

                                      +

                                      2.1

                                      c

                                      d

                                      -

                                      3

                                      +

                                      3

                                      e

                                      !! end @@ -30260,31 +30265,31 @@ parsoid={ "modes": ["wt2html", "wt2wt"] } !! wikitext -= 1 = +=1= a {{echo|1= -== 1.2 == +==1.2== b -= 2 = +=2= c }} d -= 3 = +=3= e !! html/parsoid -

                                      1

                                      +

                                      1

                                      a

                                      -

                                      1.2

                                      +

                                      1.2

                                      b

                                      -

                                      2

                                      +

                                      2

                                      c

                                      d

                                      -

                                      3

                                      +

                                      3

                                      e

                                      !! end @@ -30298,39 +30303,39 @@ parsoid={ foo
                                      -= 1 = +=1= a -== 1.1 == +==1.1== b -= 2 = +=2= c
                                      -= 3 = +=3= d -== 3.1 == +==3.1== e !! html/parsoid

                                      foo

                                      -

                                      1

                                      +

                                      1

                                      a

                                      -

                                      1.1

                                      +

                                      1.1

                                      b

                                      -

                                      2

                                      +

                                      2

                                      c

                                      -

                                      3

                                      +

                                      3

                                      d

                                      -

                                      3.1

                                      +

                                      3.1

                                      e

                                      !! end @@ -30344,44 +30349,44 @@ parsoid={ !! wikitext foo -= 1 = +=1= a
                                      b -== 1.1 == +==1.1== c -= 2 = +=2= d
                                      e -= 3 = +=3= f -== 3.1 == +==3.1== g !! html/parsoid

                                      foo

                                      -

                                      1

                                      +

                                      1

                                      a

                                      b

                                      -

                                      1.1

                                      +

                                      1.1

                                      c

                                      -

                                      2

                                      +

                                      2

                                      d

                                      e

                                      -

                                      3

                                      +

                                      3

                                      f

                                      -

                                      3.1

                                      +

                                      3.1

                                      g

                                      !! end @@ -30397,21 +30402,21 @@ foo

                                      a

                                      -= b = +=b=

                                      c

                                      -= d = +=d= !! html/parsoid

                                      foo

                                      a

                                      -

                                      b

                                      +

                                      b

                                      c

                                      -

                                      d

                                      +

                                      d

                                      !! end !! test @@ -30423,18 +30428,18 @@ parsoid={ !! wikitext -= 1 = +=1= a -= 2 = +=2= b !! html/parsoid
                                      -

                                      1

                                      +

                                      1

                                      a

                                      -

                                      2

                                      +

                                      2

                                      b

                                      !! end @@ -30447,15 +30452,103 @@ parsoid={ !! wikitext foo {{echo|
                                      -== a == -== b == +==a== +==b==
                                      }} !! html/parsoid

                                      foo

                                      -
                                      -

                                      a

                                      -

                                      b

                                      +
                                      +

                                      a

                                      +

                                      b

                                      !! end + +########################################################################## +Tests demonstrating white-space insensitivity in input wikitext +for wikitext headings, wikitext list items, and wikitext table captions, +headings, and cells. HTML versions of the same should preserve whitespace. +########################################################################## +!! test +Trim whitespace in wikitext headings, list items, table captions, headings, and cells +!! wikitext +__NOTOC__ +== Heading == +* List item +; term : definition +{| +|+ Table Caption +|- +! Table Heading 1 !! Table Heading 2 +|- +| Table Cell 1 || Table Cell 2 +|- +| class="foo" || Table Cell 3 +|- +| testing [[one|two]] | some content +|} +: {| + | Table Cell 1 || Table Cell 2 + |} foo +!! html/php+tidy +

                                      Heading[edit]

                                      +
                                      • List item
                                      +
                                      term 
                                      +
                                      definition
                                      + + + + + + + + + + + + +
                                      Table Caption +
                                      Table Heading 1Table Heading 2 +
                                      Table Cell 1Table Cell 2 +
                                      class="foo"Table Cell 3 +
                                      testing two | some content +
                                      +
                                      + + +
                                      Table Cell 1Table Cell 2 +
                                      foo
                                      +!! end + +# Looks like
    is not accepted in HTML +!! test +Do not trim whitespace in HTML headings, list items, table captions, headings, and cells +!! wikitext +__NOTOC__ +

    Heading

    +
    • List item
    + + + +
    Table Heading
    Table Cell
    +!! html/php+tidy +

    Heading

    +
    • List item
    + + + +
    Table Heading
    Table Cell
    +

    +!! end + +!! test +Do not trim whitespace in links and quotes +!! wikitext +foo '' italic '' and ''' bold ''' +[[Foo| some text ]] +!! html/php+tidy +

    foo italic and bold + some text +

    +!! end diff --git a/tests/phpunit/includes/StatusTest.php b/tests/phpunit/includes/StatusTest.php index 54c05ecc0c..6e62afdd4d 100644 --- a/tests/phpunit/includes/StatusTest.php +++ b/tests/phpunit/includes/StatusTest.php @@ -401,8 +401,8 @@ class StatusTest extends MediaWikiLangTestCase { $status, "* ⧼fooBar!⧽\n* ⧼fooBar2!⧽\n", "(wrap-long: * (fooBar!)\n* (fooBar2!)\n)", - "
    • ⧼fooBar!⧽
    • \n
    • ⧼fooBar2!⧽
    \n", - "

    (wrap-long: * (fooBar!)\n

    \n
    • (fooBar2!)
    \n

    )\n

    ", + "
    • ⧼fooBar!⧽
    • \n
    • ⧼fooBar2!⧽
    \n", + "

    (wrap-long: * (fooBar!)\n

    \n
    • (fooBar2!)
    \n

    )\n

    ", ]; $status = new Status(); @@ -422,8 +422,8 @@ class StatusTest extends MediaWikiLangTestCase { $status, "* ⧼fooBar!⧽\n* ⧼fooBar2!⧽\n", "(wrap-long: * (fooBar!: foo, bar)\n* (fooBar2!)\n)", - "
    • ⧼fooBar!⧽
    • \n
    • ⧼fooBar2!⧽
    \n", - "

    (wrap-long: * (fooBar!: foo, bar)\n

    \n
    • (fooBar2!)
    \n

    )\n

    ", + "
    • ⧼fooBar!⧽
    • \n
    • ⧼fooBar2!⧽
    \n", + "

    (wrap-long: * (fooBar!: foo, bar)\n

    \n
    • (fooBar2!)
    \n

    )\n

    ", ]; return $testCases; diff --git a/tests/phpunit/includes/content/WikitextStructureTest.php b/tests/phpunit/includes/content/WikitextStructureTest.php index 1bdbe0157b..88f4d8f74c 100644 --- a/tests/phpunit/includes/content/WikitextStructureTest.php +++ b/tests/phpunit/includes/content/WikitextStructureTest.php @@ -104,7 +104,7 @@ END; $this->assertEquals( "Opening text is opening.", $struct->getOpeningText() ); $this->assertEquals( "Opening text is opening. Then we got more text", $struct->getMainText() ); - $this->assertEquals( [ "Header table row in table another row in table" ], + $this->assertEquals( [ "Header table row in table another row in table" ], $struct->getAuxiliaryText() ); } }