Change-Id: I2963d8f2a91ec473eb7c9b063c4c5a4c2de8f82d
+!! test
+External link with comments in link text
+!! input
+[http://www.google.com Google <!-- comment -->]
+!! result
+<p><a rel="nofollow" class="external text" href="http://www.google.com">Google </a>
+</p>
+!! end
+
!! test
URL-encoding in URL functions (single parameter)
!! input
!! test
URL-encoding in URL functions (single parameter)
!! input
+!! test
+Piped link with comment in link text
+!! input
+[[Main Page|The Main<!--front--> Page]]
+!! result
+<p><a href="/wiki/Main_Page" title="Main Page">The Main Page</a>
+</p>
+!! end
+
!! test
Broken link
!! input
!! test
Broken link
!! input
+!!test
+Test the li-hack
+(Cannot test this with PHP parser since it relies on Tidy for the hack)
+!!options
+parsoid=wt2html,wt2wt
+!!input
+* foo
+* <li>li-hack
+* {{echo|<li>templated li-hack}}
+* <!--foo--> <li> unsupported li-hack with preceding comments
+
+<ul>
+<li><li>not a li-hack
+</li>
+</ul>
+!!result
+<ul><li> foo</li>
+<li>li-hack</li>
+<li about="#mwt1" typeof="mw:Transclusion" data-mw='{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"<li>templated li-hack"}}}'>templated li-hack</li>
+<li> <!--foo--> </li><li> li-hack with preceding comments</li></ul>
+
+<ul>
+<li></li><li>not a li-hack
+</li>
+</ul>
+!!end
+
parsoid
!! input
=<nowiki>=foo=</nowiki>=
parsoid
!! input
=<nowiki>=foo=</nowiki>=
==<nowiki>=foo=</nowiki>==
==<nowiki>=foo=</nowiki>==
===<nowiki>=foo=</nowiki>===
===<nowiki>=foo=</nowiki>===
====<nowiki>=foo=</nowiki>====
====<nowiki>=foo=</nowiki>====
=====<nowiki>=foo=</nowiki>=====
=====<nowiki>=foo=</nowiki>=====
======<nowiki>=foo=</nowiki>======
!! result
<h1><span typeof="mw:Nowiki">=foo=</span></h1>
======<nowiki>=foo=</nowiki>======
!! result
<h1><span typeof="mw:Nowiki">=foo=</span></h1>
!! input
=foo=
<nowiki>*bar</nowiki>
!! input
=foo=
<nowiki>*bar</nowiki>
=foo=
<nowiki>=bar=</nowiki>
!! result
=foo=
<nowiki>=bar=</nowiki>
!! result
=<nowiki>=</nowiki>=
!! result
<h1>=foo</h1>
=<nowiki>=</nowiki>=
!! result
<h1>=foo</h1>
parsoid
!! input
=<nowiki/>=
parsoid
!! input
=<nowiki/>=
======<nowiki/>======
!! result
<h1></h1>
======<nowiki/>======
!! result
<h1></h1>
-Headings: 6. Heading chars in SOL context
+Headings: 6a. Heading chars in SOL context (with trailing spaces)
!! options
parsoid
!! input
!! options
parsoid
!! input
-<!--cmt--><nowiki>=h1=</nowiki>
-<!--cmt--><nowiki> =h1= </nowiki>
-<p><!--cmt--><span typeof="mw:Nowiki">=h1=</span>
-<!--cmt--><span typeof="mw:Nowiki"> =h1= </span></p>
+<p>=a=</p>
+<p>=a= </p>
+<p>=a= </p>
+<p>=a= </p>
+!!end
+
+!! test
+Headings: 6b. Heading chars in SOL context (with trailing newlines)
+!! options
+parsoid
+!! input
+<nowiki>=a=
+b</nowiki>
+
+<nowiki>=a=
+b</nowiki>
+
+<nowiki>=a=
+b</nowiki>
+
+<nowiki>=a=
+b</nowiki>
+!! result
+<p>=a=
+b</p>
+<p>=a=
+b</p>
+<p>=a=
+b</p>
+<p>=a=
+b</p>
+</p>
+!!end
+
+!! test
+Headings: 6c. Heading chars in SOL context (leading newline break)
+!! options
+parsoid
+!! input
+<nowiki>a
+=b=</nowiki>
+!! result
+<p>a
+=b=</p>
+!!end
+
+!! test
+Headings: 6d. Heading chars in SOL context (with interspersed comments)
+!! options
+parsoid
+!! input
+<!--c0--><nowiki>=a=</nowiki>
+<!--c1-->
+<nowiki>=a= </nowiki><!--c2--> <!--c3-->
+!! result
+<p><!--c0-->=a=</p>
+<p><!--c1-->=a= <!--c2--> <!--c3--></p>
+!!end
+
+!! test
+Headings: 6d. Heading chars in SOL context (No escaping needed)
+!! options
+parsoid=html2wt
+!! input
+=a=<div>b</div>
+!! result
+=a=<div>b</div>
!!end
#### --------------- Lists ---------------
!!end
#### --------------- Lists ---------------
-#### --------------- Links ---------------
+#### --------------- Links ----------------
#### 1. Quote marks in link text
#### 2. Wikilinks: Escapes needed
#### 3. Wikilinks: No escapes needed
#### 1. Quote marks in link text
#### 2. Wikilinks: Escapes needed
#### 3. Wikilinks: No escapes needed
-#### --------------- Paragraphs ---------------
+#### ----------- Paragraphs ---------------
#### 1. No unnecessary escapes
#### --------------------------------------
#### 1. No unnecessary escapes
#### --------------------------------------
-#### --------------- PRE ------------------
-#### 1. Leading space in SOL context should be escaped
-#### --------------------------------------
+#### ----------------------- PRE --------------------------
+#### 1. Leading whitespace in SOL context should be escaped
+#### ------------------------------------------------------
-1. Leading space in SOL context should be escaped
+1. Leading whitespace in SOL context should be escaped
!! options
parsoid
!! input
!! options
parsoid
!! input
-<nowiki> foo</nowiki>
-<!--cmt--><nowiki> foo</nowiki>
+<nowiki> a</nowiki>
+
+<nowiki> a</nowiki>
+
+<nowiki> a(tab)</nowiki>
+
+<nowiki> a</nowiki>
+<!--cmt-->
+<nowiki> a</nowiki>
+
+<nowiki>a
+ b</nowiki>
+
+<nowiki>a
+ b</nowiki>
+
+<nowiki>a
+ b</nowiki>
-<p> foo
-<!--cmt--> foo
-</p>
+<p> a</p>
+<p> a</p>
+<p> a(tab)</p>
+<p> a</p>
+<p><!--cmt--> a</p>
+<p>a
+ b</p>
+<p>a
+ b</p>
+<p>a
+ b</p>
!! end
#### --------------- HTML tags ---------------
#### 1. a tags
#### 2. other tags
#### 3. multi-line html tag
!! end
#### --------------- HTML tags ---------------
#### 1. a tags
#### 2. other tags
#### 3. multi-line html tag
-#### --------------------------------------
+#### -----------------------------------------
!! test
1. a tags
!! options
!! test
1. a tags
!! options