# The parsoid-compatible option below is only relevant when we are running
# parser tests in integrated mode with Parsoid. This option is ignored
# when this test file is run with Parsoid in standalone mode.
!! options
parsoid-compatible=wt2html,wt2wt
version=2
!! end
!! article
Template:1x
!! text
{{{1}}}
!! endarticle
!! article
Template:definition_list
!! text
one
::two
!! endarticle
!! article
Help:FAQ
!! text
help!
!! end
!! test
Simple definition
!! options
parsoid=wt2html,html2html
!! wikitext
;name :Definition
!! html
- name
- Definition
!! end
!! test
Definition list for indentation only
!! wikitext
:Indented text
!! html
- Indented text
!! end
!! test
Definition list with no space
!! wikitext
;name:Definition
!! html
- name
- Definition
!!end
!! test
Definition list with URL link
!! options
parsoid=wt2html,html2html
!! wikitext
;http://example.com/ :definition
!! html/php
- http://example.com/
- definition
!! html/parsoid
- http://example.com/
- definition
!! end
!! test
Definition list with bracketed URL link
!! wikitext
;[http://www.example.com/ Example]:Something about it
!! html
- Example
- Something about it
!! end
!! test
Definition list with wikilink containing colon
!! wikitext
;[[Help:FAQ]]:The least-read page on Wikipedia
!! html/php
- Help:FAQ
- The least-read page on Wikipedia
!! html/parsoid
- Help:FAQ
- The least-read page on Wikipedia
!! end
# At Brooke's and JeLuF's insistence... :)
!! test
Definition list with news link containing colon
!! options
parsoid=wt2html,html2html
!! wikitext
;news:alt.wikipedia.rox :This isn't even a real newsgroup!
!! html/php
- news:alt.wikipedia.rox
- This isn't even a real newsgroup!
!! html/parsoid
- news:alt.wikipedia.rox
- This isn't even a real newsgroup!
!! end
!! test
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
!! end
!! test
Definition lists: colon in external link text
!! options
parsoid=wt2html,html2html
!! wikitext
;[http://www.wikipedia2.org/ Wikipedia :The Next Generation] :OK, I made that up
!! html/php
- Wikipedia :The Next Generation
- OK, I made that up
!! html/parsoid
- Wikipedia :The Next Generation
- OK, I made that up
!! end
!! test
Definition lists: colon in HTML attribute
!! wikitext
;bold
!! html
- bold
!! end
!! test
Definition lists: self-closed tag
!! options
parsoid=wt2html,html2html
!! wikitext
;one
two :two-line fun
!! html
- one
two
- two-line fun
!! end
!! test
Definition lists: ignore colons inside tags
!! wikitext
;one two : tag fun:::def
!! html
- one two : tag fun::
- def
!! end
!! test
Definition lists: excess closed tags
!! options
parsoid=wt2html,html2html
!! wikitext
;onetwo :bad tag fun
!! html/php
- onetwo
- bad tag fun
!! html/parsoid
- onetwo
- bad tag fun
!! end
!! test
T13748: Literal closing tags
!! wikitext
- test 1
- test test test test test
- test 2
- test test test test test
!! html
- test 1
- test test test test test
- test 2
- test test test test test
!! end
!! test
Definition and unordered list using wiki syntax nested in unordered list using html tags.
!! options
parsoid=wt2html,html2html
!! wikitext
-
;term :description
*unordered
!! html
!! end
!! test
Definition list with empty definition and following paragraph
!! wikitext
;term:
Paragraph text
!! html
- term
Paragraph text
!! end
!! test
Nested definition lists using html syntax
!! wikitext
- x
- a
- b
!! html
- x
- a
- b
!! end
!! test
No nesting: Multiple dd's
!! wikitext
;x
:a
:b
!! html
- x
- a
- b
!! end
!! test
Indentation: Regular
!! wikitext
:i1
::i2
:::i3
!! html
- i1
- i2
- i3
!! end
!! test
Indentation: Missing 1st level
!! wikitext
::i2
:::i3
!! html
- i2
- i3
!! end
!! test
Indentation: Multi-level indent
!! wikitext
:::i3
!! html
- i3
!! end
!! test
Hacky use to indent tables
!! wikitext
::{|
|foo
|bar
|}
this text
should be left alone
!! html
this text
should be left alone
!! end
!! test
Hacky use to indent tables (with content following table)
!! wikitext
:{|
|foo
|bar
|} this text should be part of the dl
!! html/php
- this text should be part of the dl
!! html/parsoid
- this text should be part of the dl
!! end
!! test
Hacky use to indent tables, with comments (T65979)
!! wikitext
::{|
|foo
|bar
|}
this text
should be left alone
!! html/parsoid
this text
should be left alone
!! end
!! test
Hacky use to indent tables, with comment before table
!!options
parsoid=wt2html
!! wikitext
::{|
|foo
|}
!! html/parsoid
!! end
# Note that the legacy parser closes the list completely for the
# hacky-indent table and then reopens it; Parsoid emits the "expected"
# output. Parsoid team regards this as a bug in the legacy parser.
!! test
Hack use to indent tables, in a nested list context (T262943)
!! wikitext
This is a discussion thread.
:Parent comment.
::Child comment
::{|
|With a
|Table!
|}
!! html/php
This is a discussion thread.
- Parent comment.
- Child comment
!! html/parsoid
This is a discussion thread.
- Parent comment.
- Child comment
!! end
# The trailing whitespace in this test is to catch a regression in
# Parsoid after T54473.
!! test
Hacky use to indent tables (WS-insensitive)
!! wikitext
:{|
|a
|}
!! html/php
!! html/parsoid
!! end
# wt2wt / html2wt will normalize newlines - so disabled those test modes
!! test
Hacky use to indent tables (nl-insensitive)
!! options
parsoid=wt2html,html2html
!! wikitext
:{|
|a
|}
!! html/php
!! html/parsoid
!! end
## The PHP parser treats : items (dd) without a corresponding ; item (dt)
## as an empty dt item. It also ignores all but the last ";" when followed
## by ":" later on. So, ";" are not ignored in ";;;t3" but are ignored in
## ";;;t3 :d1". So, PHP parser behavior is a little inconsistent wrt multiple
## ";"s.
##
## Ex: ";;t2 ::d2" is transformed into:
##
##
## - t2
## -
##
##
## - d2
##
##
##
##
## But, Parsoid treats "; :" as a tight atomic unit and excess ":" as plain text
## So, the same wikitext above (;;t2 ::d2) is transformed into:
##
##
## -
##
## - t2
## - :d2
##
##
##
##
## All Parsoid only definition list tests have this difference.
##
## See also: https://phabricator.wikimedia.org/T8569
## and https://lists.wikimedia.org/pipermail/wikitext-l/2011-November/000483.html
!! test
Table / list interaction: indented table with lists in table contents
!! wikitext
:{|
|-
|a
*b
|-
|c
*d
|}
!! html
!! end
!!test
Table / list interaction: lists nested in tables nested in indented lists
!! wikitext
:{|
|
:a
:b
|
*c
*d
|}
*e
*f
!! html
!!end
!! test
Nesting: Multi-level (Parsoid only)
!! wikitext
;t1:d1
;;t2::d2
;;;t3:::d3
!! html/parsoid
- t1
- d1
-
- t2
- :d2
-
- t3
- ::d3
!! end
!! test
Nesting: Test 2
!! wikitext
;t1
::d2
!! html
- t1
-
- d2
!! end
!! test
Nesting: Test 3
!! wikitext
:;t1
::::d2
!! html
- t1
-
- d2
!! end
!! test
Nesting: Test 4
!! wikitext
::;t3
:::d3
!! html
- t3
- d3
!! end
## The Parsoid team believes the following three test exposes a
## bug in the PHP parser. (Parsoid team thinks the PHP parser is
## wrong to close the after the - containing the
.)
## It also exposes a "misfeature" in tidy, which doesn't like
## tags with a single - child; it converts the
- into
## a
- in that case. (Parsoid leaves the
- alone!)
!! test
Mixed Lists: Test 1
!! wikitext
:;*foo
::*bar
:;baz
!! html/php
- baz
!! html/php
- baz
!! html/parsoid
- baz
!! end
!! test
Mixed Lists: Test 2
!! wikitext
*:d1
*:d2
!! html
!! end
!! test
Mixed Lists: Test 3
!! wikitext
*:::d1
*:::d2
!! html
!! end
!! test
Mixed Lists: Test 4
!! options
parsoid=wt2html,html2html
!! wikitext
*;d1 :d2
*;d3 :d4
!! html
!! end
!! test
Mixed Lists: Test 5
!! wikitext
*:d1
*::d2
!! html
!! end
!! test
Mixed Lists: Test 6
!! wikitext
#*:d1
#*:::d3
!! html
!! end
!! test
Mixed Lists: Test 7
!! wikitext
:*d1
:*d2
!! html
!! end
!! test
Mixed Lists: Test 8
!! wikitext
:*d1
::*d2
!! html
-
!! end
!! test
Mixed Lists: Test 9
!! options
parsoid=wt2html,html2html
!! wikitext
*;foo :bar
!! html
!! end
!! test
Mixed Lists: Test 10
!! options
parsoid=wt2html,html2html
!! wikitext
*#;foo :bar
!! html
!! end
# The Parsoid team disagrees with the PHP parser's seemingly-random
# rules regarding dd/dt on the next few tests. Parsoid is more
# consistent, and recognizes the shared nesting and keeps the
# still-open tags around until the nesting is complete.
# This is a regression test for T175099
!! test
Mixed Lists: Test 11
!! wikitext
;a
:*b
!! html/php
- a
-
!! html/parsoid
- a
!! end
!! test
Mixed Lists: Test 13
!! options
parsoid=wt2html,html2html
!! wikitext
*#*#;*;;foo : bar
*#*#;boo : baz
!! html
- boo
- baz
!! end
!! test
colons occurring in tags
!! wikitext
;a:b
;'''a:b'''
;a:b
;a:b
;a:b
;a
:b
;{{1x|a:b}}
;{{1x|''a:b''}}
;;;''a:b''
!! html/php
- a
- b
- a:b
- a:b
- a:b
a:b
a
- b
- a
- b
- a:b
- a:b
!! html/parsoid
- a
- b
- a:b
- a:b
- a:b
a:b
a
- b
- a:b
- a:b
- a:b
!! end
# Parsoid's output is preferable here because it shares
# nesting between the two lists unlike the legacy parser.
!! test
colons and tables 1
!! wikitext
:{|
|x
|}
:{|
|y
|}
!! html/php
!! html/parsoid
!! end
# FIXME: Does this need a html/php section?
!! test
Template interaction
!! wikitext
::{{definition_list}}
:one
::{{definition_list}}
:::two
:::three
::four
!! html/parsoid
- one
- two
- one
- one
- two
- two
- three
- four
!! end
!! test
Second colon on line: No templates involved
!! options
parsoid=wt2html,wt2wt
!! wikitext
;term:def=foo:bar
;'''1:00''':bar
!! html/php
- term
- def=foo:bar
- 1:00
- bar
!! html/parsoid
- term
- def=foo:bar
- 1:00
- bar
!! end
!! test
Second colon on line: Templates involved and T2959 kicks in
!! options
parsoid=wt2html,wt2wt
!! wikitext
:a
::{{1x|1=::foo}} bar
;term:def=foo{{1x|:bar}}
!! html/php
- a
- foo bar
- term
- def=foo
- bar
!! html/parsoid+integrated
- a
- foo bar
- term
- def=foo
- bar
!! end