Fixed some problems image's autoalign and ul, ol
This commit is contained in:
parent
ed62d52959
commit
d02f5bf845
2 changed files with 130 additions and 58 deletions
|
@ -24,14 +24,20 @@ namespace ScrewTurn.Wiki.Tests {
|
|||
[TestCase("<sub>text</sub>", "<sub>text</sub>")]
|
||||
[TestCase("<pre><b>text</b></pre>", "@@text@@")]
|
||||
[TestCase("<code><b>text</b></code>", "{{'''text'''}}")]
|
||||
[TestCase("<div class=\"box\">text</div>","(((text))){br}")]
|
||||
[TestCase("<div class=\"box\">text</div>", "(((text))){br}")]
|
||||
[TestCase("<div>text</div>", "text{br}")]
|
||||
[TestCase("<ol><li>1</li><li>2</li></ol>","{br}# 1{br}# 2{br}{br}")]
|
||||
[TestCase("<ul><li>1</li><li>2</li></ul>", "{br}* 1{br}* 2{br}{br}")]
|
||||
[TestCase("<a id=\"Init\" />I'm an anchor", "[anchor|#init]I'm an anchor")]
|
||||
[TestCase("<a class=\"internallink\" href=\"#init\" title=\"This recall an anchor\">This recall an anchor</a>", "[#init|This recall an anchor]")]
|
||||
[TestCase("<a class=\"externallink\" href=\"google.com\" title=\"BIG TITLE\" target=\"_blank\">BIG TITLE</a>","[^google.com|BIG TITLE]")]
|
||||
[TestCase("<esc>try to esc tag</esc>","<esc>try to esc tag</esc>")]
|
||||
[TestCase("<ol><li>1</li><li>2</li></ol>", "# 1{br}# 2{br}{br}")]
|
||||
[TestCase("<ul><li>1</li><li>2</li></ul>", "* 1{br}* 2{br}{br}")]
|
||||
//[TestCase("<ul><li>it 1<ul><li>1.1</li><li>1.2</li></ul></li><li>it2</li></ul>", "* it 1{br}** 1.1{br}** 1.2{br}* it2{br}{br}")]
|
||||
//[TestCase("<ul><li>it 1<ol><li>1.1</li><li>1.2</li></ol></li><li>it2</li></ul>", "* it 1{br}*# 1.1{br}*# 1.2{br}* it2{br}{br}")]
|
||||
[TestCase("<html><a id=\"Init\" />I'm an anchor</html>", "[anchor|#init]I'm an anchor")]
|
||||
[TestCase("<html><a class=\"internallink\" href=\"#init\" title=\"This recall an anchor\">This recall an anchor</a></html>", "[#init|This recall an anchor]")]
|
||||
[TestCase("<html><a class=\"externallink\" href=\"google.com\" title=\"BIG TITLE\" target=\"_blank\">BIG TITLE</a></html>", "[^google.com|BIG TITLE]")]
|
||||
[TestCase("<esc>try to esc tag</esc>", "<esc>try to esc tag</esc>")]
|
||||
[TestCase("<div class=\"imageleft\"><a target=\"_blank\" href=\"www.link.com\" title=\"left Align\"><img class=\"image\" src=\"GetFile.aspx?Page=MainPage&File=image.png\" alt=\"left Align\" /></a><p class=\"imagedescription\">leftalign</p></div>", "[imageleft|leftalign|{UP(MainPage)}image.png|^www.link.com]{br}")]
|
||||
[TestCase("<img src=\"GetFile.aspx?Page=MainPage&File=image.png\" alt=\"inlineimage\" />", "[image|inlineimage|{UP(MainPage)}image.png]{br}")]
|
||||
[TestCase("<table class=\"imageauto\" cellpadding=\"0\" cellspacing=\"0\"><tbody><tr><td><img class=\"image\" src=\"GetFile.aspx?Page=MainPage&File=image.png\" alt=\"autoalign\" /><p class=\"imagedescription\">autoalign</p></td></tr></tbody></table>", "[imageauto|autoalign|{UP(MainPage)}image.png]{br}")]
|
||||
[TestCase("<table class=\"imageauto\" cellpadding=\"0\" cellspacing=\"0\"><tbody><tr><td><a href=\"www.link.com\" title=\"Auto align\"><img class=\"image\" src=\"GetFile.aspx?Page=MainPage&File=image.png\" alt=\"Auto align\" /></a><p class=\"imagedescription\">Auto align</p></td></tr></tbody></table>", "[imageauto|Auto align|{UP(MainPage)}image.png|^www.link.com]")]
|
||||
public void PlainTest(string input, string output) {
|
||||
Assert.AreEqual(output, ReverseFormatter.ReverseFormat(input));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue