mediacloth 0.0.3 → 0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. data/README.md +36 -0
  2. data/lib/mediacloth/mediawikiast.rb +58 -1
  3. data/lib/mediacloth/mediawikihtmlgenerator.rb +229 -73
  4. data/lib/mediacloth/mediawikilexer.rb +1030 -656
  5. data/lib/mediacloth/mediawikilinkhandler.rb +89 -0
  6. data/lib/mediacloth/mediawikiparams.rb +1 -10
  7. data/lib/mediacloth/mediawikiparser.rb +939 -409
  8. data/lib/mediacloth/mediawikiparser.tab.rb +1357 -0
  9. data/lib/mediacloth/mediawikiparser.y +256 -52
  10. data/lib/mediacloth/mediawikisignedwikigenerator.rb +42 -0
  11. data/lib/mediacloth/mediawikitemplatehandler.rb +8 -0
  12. data/lib/mediacloth/mediawikiwalker.rb +72 -1
  13. data/lib/mediacloth.rb +33 -10
  14. data/test/data/ast1 +68 -0
  15. data/test/data/ast10 +196 -0
  16. data/test/data/ast11 +34 -0
  17. data/test/data/ast12 +39 -0
  18. data/test/data/ast13 +25 -0
  19. data/test/data/ast14 +13 -0
  20. data/test/data/ast15 +25 -0
  21. data/test/data/ast16 +17 -0
  22. data/test/data/ast17 +9 -0
  23. data/test/data/ast18 +21 -0
  24. data/test/data/ast19 +32 -0
  25. data/test/data/ast2 +4 -0
  26. data/test/data/ast20 +10 -0
  27. data/test/data/ast21 +27 -0
  28. data/test/data/ast22 +22 -0
  29. data/test/data/ast23 +5 -0
  30. data/test/data/ast3 +6 -0
  31. data/test/data/ast4 +122 -0
  32. data/test/data/ast5 +122 -0
  33. data/test/data/ast6 +22 -0
  34. data/test/data/ast7 +143 -0
  35. data/test/data/ast8 +3 -0
  36. data/test/data/ast9 +11 -0
  37. data/test/data/html1 +33 -5
  38. data/test/data/html10 +31 -27
  39. data/test/data/html11 +19 -0
  40. data/test/data/html12 +32 -0
  41. data/test/data/html13 +29 -0
  42. data/test/data/html14 +4 -0
  43. data/test/data/html15 +29 -0
  44. data/test/data/html16 +28 -0
  45. data/test/data/html17 +10 -0
  46. data/test/data/html18 +8 -0
  47. data/test/data/html19 +27 -0
  48. data/test/data/html2 +1 -1
  49. data/test/data/html20 +7 -0
  50. data/test/data/html21 +5 -0
  51. data/test/data/html22 +24 -0
  52. data/test/data/html23 +7 -0
  53. data/test/data/html3 +1 -1
  54. data/test/data/html4 +60 -11
  55. data/test/data/html5 +45 -6
  56. data/test/data/html6 +5 -5
  57. data/test/data/html7 +59 -1
  58. data/test/data/html8 +1 -1
  59. data/test/data/html9 +10 -2
  60. data/test/data/input1 +4 -0
  61. data/test/data/input11 +19 -0
  62. data/test/data/input12 +32 -0
  63. data/test/data/input13 +10 -0
  64. data/test/data/input14 +8 -0
  65. data/test/data/input15 +10 -0
  66. data/test/data/input16 +28 -0
  67. data/test/data/input17 +10 -0
  68. data/test/data/input18 +16 -0
  69. data/test/data/input19 +29 -0
  70. data/test/data/input20 +8 -0
  71. data/test/data/input21 +18 -0
  72. data/test/data/input22 +20 -0
  73. data/test/data/input23 +8 -0
  74. data/test/data/input4 +13 -1
  75. data/test/data/input5 +45 -4
  76. data/test/data/input7 +25 -1
  77. data/test/data/lex1 +17 -18
  78. data/test/data/lex10 +57 -87
  79. data/test/data/lex11 +18 -0
  80. data/test/data/lex12 +32 -0
  81. data/test/data/lex13 +3 -0
  82. data/test/data/lex14 +1 -0
  83. data/test/data/lex15 +3 -0
  84. data/test/data/lex16 +27 -0
  85. data/test/data/lex17 +9 -0
  86. data/test/data/lex18 +4 -0
  87. data/test/data/lex19 +27 -0
  88. data/test/data/lex2 +2 -2
  89. data/test/data/lex20 +7 -0
  90. data/test/data/lex21 +4 -0
  91. data/test/data/lex22 +3 -0
  92. data/test/data/lex23 +7 -0
  93. data/test/data/lex3 +1 -1
  94. data/test/data/lex4 +35 -29
  95. data/test/data/lex5 +57 -18
  96. data/test/data/lex6 +7 -7
  97. data/test/data/lex7 +42 -18
  98. data/test/data/lex8 +1 -1
  99. data/test/data/lex9 +6 -6
  100. data/test/dataproducers/ast.rb +24 -0
  101. data/test/dataproducers/html.rb +11 -12
  102. data/test/dataproducers/lex.rb +9 -4
  103. data/test/debugwalker.rb +25 -11
  104. data/test/htmlgenerator.rb +170 -13
  105. data/test/lexer.rb +626 -83
  106. data/test/linkhandler.rb +39 -0
  107. data/test/parser.rb +176 -9
  108. data/test/signedwikigenerator.rb +113 -0
  109. metadata +158 -79
  110. data/README +0 -37
  111. data/lib/mediacloth/mediawikilexer.rb~ +0 -491
  112. data/lib/mediacloth/mediawikiparser.y~ +0 -210
  113. data/test/data/result1 +0 -48
  114. data/test/dataproducers/html.rb~ +0 -24
  115. data/test/dataproducers/lex.rb~ +0 -15
data/test/data/html14 ADDED
@@ -0,0 +1,4 @@
1
+ <h1><a name='Headline1'></a> Headline1 </h1>
2
+ <pre>Something</pre><h2><a name='Headline2'></a> Headline2 </h2>
3
+ <pre>Something</pre><h2><a name='Headline3'></a> Headline3 </h2>
4
+ <pre>Something</pre>
data/test/data/html15 ADDED
@@ -0,0 +1,29 @@
1
+ <div class="wikitoc">
2
+ <div class="wikitoctitle">Contents</div>
3
+ <ul>
4
+ <li><a href='#Headline1'><span class="wikitocnumber">1.</span><span class="wikitoctext">Headline1</span></a>
5
+ <ul>
6
+ <li><a href='#Sub_Headline_1a'><span class="wikitocnumber">1.1.</span><span class="wikitoctext">Sub Headline 1a</span></a>
7
+ <li><a href='#Sub_Headline_1b'><span class="wikitocnumber">1.2.</span><span class="wikitoctext">Sub Headline 1b</span></a>
8
+ </ul>
9
+ <li><a href='#Headline2'><span class="wikitocnumber">2.</span><span class="wikitoctext">Headline2</span></a>
10
+ <ul>
11
+ <li><a href='#Sub_Headline_2a'><span class="wikitocnumber">2.1.</span><span class="wikitoctext">Sub Headline 2a</span></a>
12
+ <ul>
13
+ <li><a href='#Sub_Sub_Headline_2i'><span class="wikitocnumber">2.1.1.</span><span class="wikitoctext">Sub Sub Headline <i>2i</i></span></a>
14
+ <li><a href='#Sub_Sub_Headline_2ii'><span class="wikitocnumber">2.1.2.</span><span class="wikitoctext">Sub Sub Headline <b>2ii</b></span></a>
15
+ </ul>
16
+ <li><a href='#Sub_Headline_2b'><span class="wikitocnumber">2.2.</span><span class="wikitoctext">Sub Headline 2b</span></a>
17
+ </ul>
18
+ </ul>
19
+ </div>
20
+ <p><br />
21
+
22
+ </p><h2><a name='Headline1'></a> Headline1 </h2>
23
+ <h3><a name='Sub_Headline_1a'></a> Sub Headline 1a </h3>
24
+ <h3><a name='Sub_Headline_1b'></a> Sub Headline 1b </h3>
25
+ <h2><a name='Headline2'></a> Headline2 </h2>
26
+ <h3><a name='Sub_Headline_2a'></a> Sub Headline 2a </h3>
27
+ <h4><a name='Sub_Sub_Headline_2i'></a> Sub Sub Headline <i>2i</i> </h4>
28
+ <h4><a name='Sub_Sub_Headline_2ii'></a> Sub Sub Headline <b>2ii</b> </h4>
29
+ <h3><a name='Sub_Headline_2b'></a> Sub Headline 2b </h3>
data/test/data/html16 ADDED
@@ -0,0 +1,28 @@
1
+ <h2><a name='Section'></a> Section </h2>
2
+ <p>Some text.
3
+
4
+ </p><pre class="indent">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
5
+ &lt;!DOCTYPE plist PUBLIC &quot;-//Apple Computer//DTD PLIST 1.0//EN&quot; &quot;<a href="http://www.apple.com/DTDs/PropertyList-1.0.dtd">http://www.apple.com/DTDs/PropertyList-1.0.dtd</a>&quot;&gt;
6
+ &lt;plist version=&quot;1.0&quot;&gt;
7
+ &lt;dict&gt;
8
+ &lt;key&gt;Label&lt;/key&gt;
9
+ &lt;string&gt;Update svn repo&lt;/string&gt;
10
+ &lt;key&gt;ProgramArguments&lt;/key&gt;
11
+ &lt;array&gt;
12
+ &lt;string&gt;updatesvn.sh&lt;/string&gt;
13
+ &lt;/array&gt;
14
+ &lt;key&gt;StandardErrorPath&lt;/key&gt;
15
+ &lt;string&gt;/dev/null&lt;/string&gt;
16
+ &lt;key&gt;StandardOutPath&lt;/key&gt;
17
+ &lt;string&gt;/dev/null&lt;/string&gt;
18
+ &lt;key&gt;StartCalendarInterval&lt;/key&gt;
19
+ &lt;dict&gt;
20
+ &lt;key&gt;Hour&lt;/key&gt;
21
+ &lt;integer&gt;16&lt;/integer&gt;
22
+ &lt;key&gt;Minute&lt;/key&gt;
23
+ &lt;integer&gt;40&lt;/integer&gt;
24
+ &lt;/dict&gt;
25
+ &lt;/dict&gt;
26
+ &lt;/plist&gt;
27
+ </pre><p>
28
+ Some text.<br />Some other text.<br />Foo.<hr /><img src="foo" /></p>
data/test/data/html17 ADDED
@@ -0,0 +1,10 @@
1
+ <table cellpadding="5" border="1"><tr><td> foo
2
+ bar
3
+ zee
4
+ </td><td> moo
5
+ goo
6
+ </td><td attr="value" otherattr="othervalue" > nah
7
+ mah
8
+ bah
9
+ </td></tr>
10
+ </table>
data/test/data/html18 ADDED
@@ -0,0 +1,8 @@
1
+ <h2><a name='Foobar'></a> Foobar </h2>
2
+ <table border="1px" cellpadding="5"><tr><th>test
3
+ </th></tr>
4
+ <tr><td>a
5
+ </td></tr>
6
+ </table>
7
+ <h2><a name='Foobar'></a> Foobar </h2>
8
+ <table border="1px"><thead><tr><th>test</th></tr></thead><tbody><tr><td>a</td></tr></tbody></table>
data/test/data/html19 ADDED
@@ -0,0 +1,27 @@
1
+ <pre>
2
+ foo bar
3
+ </pre><p><code>
4
+ foo bar
5
+ </code>
6
+
7
+ </p><p> hi <br /> bye</p><p><br />
8
+
9
+ </p><p>test &lt;br/&gt; test
10
+
11
+ </p><p>There's something important in this example: <code>int a = <b>2</b>+2;</code> but I don't know what.
12
+
13
+ </p><p>
14
+ There's something important in this example: <code>int a = 2+2;<br />
15
+
16
+ int b = a + 2;
17
+ </code> but I don't know what.
18
+
19
+ </p><pre>
20
+ Here's some code:
21
+
22
+ &lt;code&gt;
23
+ int a = 2+2;
24
+
25
+ int b = 3+4;
26
+ &lt;/code&gt;
27
+ </pre>
data/test/data/html2 CHANGED
@@ -1,2 +1,2 @@
1
- <hr></hr><p>
1
+ <hr/><p>
2
2
  This is a text</p>
data/test/data/html20 ADDED
@@ -0,0 +1,7 @@
1
+ <table border="1" cellpadding="2" cellspacing="0"><tr><td> xxx
2
+ </td><td><pre class="indent">test
3
+ test
4
+ test
5
+ </pre></td><td> yyy
6
+ </td></tr>
7
+ </table>
data/test/data/html21 ADDED
@@ -0,0 +1,5 @@
1
+ <div class="paste" style="white-space: pre-wrap;">This is '''some''' text pasted from anywhere<br />with<br />new<br />lines<br />and multiple spaces and tabs<br /> and space<br /> and two spaces<br />with some<br />&lt;p attr=&quot;xxx&quot; moo=&quot;zzz&quot; bar=zzzzz&gt;HTML formatted &lt;a href=&quot;foo.bar&quot;&gt;text&lt;/a&gt; in &lt;/p&gt; it.<br /></div><p>
2
+
3
+
4
+ </p><h2><a name='Section'></a> Section </h2>
5
+ <div class="paste" style="white-space: pre-wrap;">Foo</div>
data/test/data/html22 ADDED
@@ -0,0 +1,24 @@
1
+ <div class="wikitoc">
2
+ <div class="wikitoctitle">Contents</div>
3
+ <ul>
4
+ <li><a href='#Headline1'><span class="wikitocnumber">1.</span><span class="wikitoctext">Headline1</span></a>
5
+ <ul>
6
+ <li><a href='#Sub_Headline_1a'><span class="wikitocnumber">1.1.</span><span class="wikitoctext">Sub Headline 1a</span></a>
7
+ <li><a href='#Sub_Headline_1b'><span class="wikitocnumber">1.2.</span><span class="wikitoctext">Sub Headline 1b</span></a>
8
+ </ul>
9
+ <li><a href='#Headline2'><span class="wikitocnumber">2.</span><span class="wikitoctext">Headline2</span></a>
10
+ <ul>
11
+ <li><a href='#Sub_Headline_2a'><span class="wikitocnumber">2.1.</span><span class="wikitoctext">Sub Headline 2a</span></a>
12
+ <li><a href='#Sub_Headline_2b'><span class="wikitocnumber">2.2.</span><span class="wikitoctext">Sub Headline 2b</span></a>
13
+ </ul>
14
+ </ul>
15
+ </div>
16
+ <p><br />
17
+
18
+ </p><p><div><h1><a name='Headline1'></a> Headline1 </h1>
19
+ <span><h2><a name='Sub_Headline_1a'></a> Sub Headline 1a </h2>
20
+ </span><h2><a name='Sub_Headline_1b'></a> Sub Headline 1b </h2>
21
+ </div></p><h1><a name='Headline2'></a> Headline2 </h1>
22
+ <table><tr><td><h2><a name='Sub_Headline_2a'></a> Sub Headline 2a </h2>
23
+ </td><td><h2><a name='Sub_Headline_2b'></a> Sub Headline 2b </h2>
24
+ </td></tr></table>
data/test/data/html23 ADDED
@@ -0,0 +1,7 @@
1
+ <pre>
2
+ This is
3
+ preformatted text
4
+
5
+ </pre><pre class="indent">And this is
6
+ preformatted text
7
+ </pre>
data/test/data/html3 CHANGED
@@ -1 +1 @@
1
- <p>--Sat Jan 01 01:01:01 UTC 2000CreatorCreator Sat Jan 01 01:01:01 UTC 2000</p>
1
+ <p>--Sat Jan 01, 2000 01:01<a href="javascript:void(0)">Creator</a><a href="javascript:void(0)">Creator</a> Sat Jan 01, 2000 01:01</p>
data/test/data/html4 CHANGED
@@ -1,11 +1,60 @@
1
- <p>Test mixing of bold and italic formatting:</p><p><i>italic<b>bold</b>italic</i></p><p><b>bold<i>italic</i>bold</b></p><p><i><b>boldalic</b></i></p><p><i>italic<b>bold</b>italic</i><b>bold<i>italic</i>bold</b></p><p>
2
- Test bold and italic wrapped around inline links:</p><p><i><a href="http://example.com">http://example.com</a></i></p><p><b><a href="http://example.com">http://example.com</a></b></p><p><i><a href="http://example.com'">http://example.com'</a></i></p><p><b><a href="http://example.com'">http://example.com'</a> is good</b></p><p><i><a href="http://example.com'">http://example.com'</a> is good</i></p><p>
3
- Test unclosed bold and italic formatting:</p><p><i>Some italic and now </i>bold
4
- </p><h2>Heading</h2><p>
5
- Text</p><p><i>Some italic and now <b>bold
6
- </b></i></p><h2>Heading</h2><p>
7
- Text</p><p><i>Some italic and now <b>bold</b></i></p><h2>Heading</h2><p>
8
- Text</p><p><i>Some italic and now <b>bold
9
- </b></i></p><ul><li>one
10
- </li><li>two
11
- </li></ul><p><i>Some italic and now <b>bold</b></i></p><p>Text</p>
1
+ <p>Test mixing of bold and italic formatting:
2
+
3
+ </p><p><i>italic<b>bold</b>italic</i>
4
+
5
+ </p><p><b>bold<i>italic</i>bold</b>
6
+
7
+ </p><p><i><b>boldalic</b></i>
8
+
9
+ </p><p><i>italic<b>bold</b>italic</i><b>bold<i>italic</i>bold</b>
10
+
11
+ </p><p>
12
+ Test bold and italic wrapped around inline links:
13
+
14
+ </p><p><i><a href="http://example.com">http://example.com</a></i>
15
+
16
+ </p><p><b><a href="http://example.com">http://example.com</a></b>
17
+
18
+ </p><p><i><a href="http://example.com">http://example.com</a><b>
19
+
20
+ </b></i></p><p><b><a href="http://example.com">http://example.com</a>' is good</b>
21
+
22
+ </p><p><i><a href="http://example.com">http://example.com</a>' is good</i>
23
+
24
+ </p><p>
25
+ Test unclosed bold and italic formatting:
26
+
27
+ </p><p><i>Some italic and now </i>bold
28
+ </p><h2><a name='Heading'></a>Heading</h2>
29
+ <p>Text
30
+
31
+ </p><p><i>Some italic and now <b>bold
32
+ </b></i></p><h2><a name='Heading'></a>Heading</h2>
33
+ <p>
34
+ Text
35
+
36
+ </p><p><i>Some italic and now <b>bold
37
+
38
+ </b></i></p><h2><a name='Heading'></a>Heading</h2>
39
+ <p><br />
40
+
41
+ </p><p>Text
42
+
43
+ </p><p><i>Some italic and now <b>bold
44
+ </b></i></p><ul><li> one
45
+ </li><li> two
46
+ </li></ul><p><br />
47
+
48
+ </p><p><i>Some italic and now <b>bold
49
+
50
+ </b></i></p><p>Text
51
+
52
+ </p><p>Invalid and weird sections:
53
+ </p><h6><a name='===='></a>====</h6>
54
+ <p>
55
+ =
56
+ ==
57
+ </p><h1><a name='='></a>=</h1>
58
+ <h1><a name='=='></a>==</h1>
59
+ <h2><a name='='></a>=</h2>
60
+ <h2><a name='=='></a>==</h2>
data/test/data/html5 CHANGED
@@ -1,18 +1,57 @@
1
- <ul><li>A
1
+ <p>Unordered lists
2
+
3
+ </p><ul><li>A
2
4
  <ul><li>A
3
5
  <ul><li>a
4
6
  </li><li>b
5
7
  <ul><li>a
6
8
  </li></ul></li></ul></li></ul></li><li>B
7
9
  <ul><li>b
8
- </li></ul></li></ul><ol><li>a
10
+ </li></ul></li></ul><ul><li>A
11
+ </li><li>B
12
+ </li><li></li></ul><p>
13
+ Ordered lists
14
+
15
+ </p><ol><li>a
9
16
  <ol><li>a
10
17
  <ol><li>a
11
18
  <ol><li>a
12
19
  </li></ol></li></ol></li></ol></li><li>a
13
20
  <ol><li>aa
14
- </li></ol></li></ol><ul><li>A
15
- </li><li>B
16
- </li><li></li></ul><ol><li>A
21
+ </li></ol></li></ol><ol><li>A
17
22
  </li><li>B
18
- </li><li></li></ol>
23
+ </li><li></li></ol><p>
24
+ Mixed lists
25
+
26
+ </p><ul><li>a
27
+ <ol><li>1
28
+ </li><li>2
29
+ </li></ol></li><li>b
30
+ </li></ul><ol><li>a
31
+ <ul><li>1
32
+ </li><li>2
33
+ <ul><li>2
34
+ </li></ul></li></ul></li><li>b
35
+ </li></ol><p>
36
+ Dictionary lists
37
+
38
+ </p><dl><dt>d
39
+ </dt></dl><p><br />
40
+
41
+ </p><dl><dd>t
42
+ </dd></dl><p><br />
43
+
44
+ </p><dl><dt>d
45
+ </dt><dd>t
46
+ </dd></dl><p><br />
47
+
48
+ </p><dl><dt>d
49
+ </dt><dd>t
50
+ </dd><dd>t
51
+ </dd></dl><p><br />
52
+
53
+ </p><dl><dt>d
54
+ </dt><dd>t
55
+ </dd></dl><dl><dt>d
56
+ </dt><dd>t
57
+ </dd></dl><dl><dt>d </dt><dd>t <a href="image:foo.jpg">image:foo.jpg</a></dd></dl>
data/test/data/html6 CHANGED
@@ -1,8 +1,8 @@
1
1
  <p>This is some text with <b>bold</b> and <i>italic</i> formating.
2
2
  The list is also here:
3
- </p><ul><li>List Item 1
4
- <ul><li>Sub list item 1
5
- </li><li>Sub list item 2
6
- </li></ul></li><li>List Item 2
3
+ </p><ul><li> List Item 1
4
+ <ul><li> Sub list item 1
5
+ </li><li> Sub list item 2
6
+ </li></ul></li><li> List Item 2
7
7
  </li></ul><p>The end
8
- </p><hr></hr>
8
+ </p><hr/>
data/test/data/html7 CHANGED
@@ -1 +1,59 @@
1
- <p><a href="http://sun.com">http://sun.com</a></p><p><a href="http://sun.com">http://sun.com</a></p><p><a href="mailto:joe@sun.com">mailto:joe@sun.com</a></p><p><a href="http://sun.com">stars</a></p><p><a href="http://sun.com">stars and moon</a></p><p><a href="http://sun.com">stars and <i>moon</i>and <b>trees</b>and birds</a></p><p><a href="javascript:void(0)">sun</a></p><p><a href="javascript:void(0)">All about Sun</a></p><p><a href="javascript:void(0)">image:sun(All about Sun)</a></p><p><a href="javascript:void(0)">nofollow|All about Sun</a></p><p><a href="javascript:void(0)">image:sun(nofollow, All about Sun)</a></p><p><a href="javascript:void(0)">image:sun(All about <a href="javascript:void(0)">Sun</a>)</a></p><p><a href="javascript:void(0)">image:sun(All about <a href="javascript:void(0)">More about</a>)</a></p><p><a href="javascript:void(0)">image:sun(one, two, three)</a></p><p>[]</p><p>[ ]</p><p>[[]]</p><p>[[ ]]</p>
1
+ <p><a href="http://sun.com">http://sun.com</a>
2
+
3
+ </p><p><a href="http://sun.com:80">http://sun.com:80</a>
4
+
5
+ </p><p><a href="http://sun.com">http://sun.com</a>
6
+
7
+ </p><p><a href="mailto:joe@sun.com">mailto:joe@sun.com</a>
8
+
9
+ </p><p><a href="http://sun.com">stars</a>
10
+
11
+ </p><p><a href="http://sun.com">stars and moon</a>
12
+
13
+ </p><p><a href="http://sun.com">stars and <i>moon</i> and <b>trees</b> and birds</a>
14
+
15
+ </p><p><a href="http://sun.com"><tt>sun</tt> and <tt>moon</tt></a>
16
+
17
+ </p><p><a href="http://sun.com">sun &gt; moon</a>
18
+
19
+ </p><p><a href="javascript:void(0)">sun</a>
20
+
21
+ </p><p><a href="javascript:void(0)">All about Sun</a>
22
+
23
+ </p><p><a href="image:sun">image:sun</a>
24
+
25
+ </p><p><a href="javascript:void(0)">nofollow|All about Sun</a>
26
+
27
+ </p><p><a href="javascript:void(0)">nofollow|Sun &gt; Moon</a>
28
+
29
+ </p><p><a href="javascript:void(0)">nofollow|<tt>sun</tt> and <tt>moon</tt></a>
30
+
31
+ </p><p><a href="image:sun">image:sun</a>
32
+
33
+ </p><p><a href="image:sun">image:sun</a>
34
+
35
+ </p><p><a href="image:sun">image:sun</a>
36
+
37
+ </p><p><a href="image:sun">image:sun</a>
38
+
39
+ </p><p><a href="image:sun">image:sun</a>
40
+
41
+ </p><p>[]
42
+
43
+ </p><p>[ ]
44
+
45
+ </p><p>[[]]
46
+
47
+ </p><p><a href="javascript:void(0)"> </a>
48
+
49
+ </p><p>
50
+
51
+ </p><p>
52
+
53
+ </p><p>
54
+
55
+ </p><p><a href="javascript:void(0)">Category</a>
56
+
57
+ </p><p><a href="javascript:void(0)">Category name</a>
58
+
59
+ </p><p><a href="javascript:void(0)">Foo</a></p>
data/test/data/html8 CHANGED
@@ -1 +1 @@
1
- <h3> foo </h3>
1
+ <h3><a name='foo'></a> foo </h3>
data/test/data/html9 CHANGED
@@ -1,6 +1,14 @@
1
- <p>Some examples of wiki escaping.</p><p>A paragraph with some wiki characters: ''italic'' '''bold''' [[Link]]</p><p>An escaped list:
1
+ <p>Some examples of wiki escaping.
2
+
3
+ </p><p>A paragraph with some wiki characters: ''italic'' '''bold''' [[Link]]
4
+
5
+ </p><p>An escaped list:
2
6
 
3
7
  * one
4
8
  * two
5
9
  * three
6
- </p><p>Text escaped in a heading:</p><h2>Heading with '''</h2>
10
+
11
+
12
+ </p><p>Text escaped in a heading:
13
+
14
+ </p><h2><a name='Heading_with____'></a>Heading with '''</h2>
data/test/data/input1 CHANGED
@@ -8,6 +8,8 @@ Another one.
8
8
 
9
9
  This is text with [[Internal Link]] and [http://www.example.com external link].
10
10
 
11
+ http://inline.link/with?at@character
12
+
11
13
  We can have headlines:
12
14
 
13
15
 
@@ -32,3 +34,5 @@ This is a text after the line.
32
34
 
33
35
  *foo
34
36
  * foo2
37
+
38
+ == There aren't any closing quotes inside this headline's name ==
data/test/data/input11 ADDED
@@ -0,0 +1,19 @@
1
+ ==Examples of XHTML markup and escaping of XML characters==
2
+
3
+ Here is a <tt>code sample</tt>.
4
+
5
+ Another <tt class='code'>code sample</tt>.
6
+ Another <tt class="code">code sample</tt>.
7
+ Another <tt class=code>code sample</tt>.
8
+
9
+ An example of a <nowiki><tt>code sample</tt></nowiki>.
10
+
11
+ Some math:
12
+
13
+ 1 < 2 & 1 > 0
14
+
15
+ And more text.
16
+
17
+ * one
18
+ * two <span>a b
19
+ c d e f</span>
data/test/data/input12 ADDED
@@ -0,0 +1,32 @@
1
+ one &amp; two
2
+ 1 &lt; 2
3
+ &lt;lt; is the "lt" symbol
4
+ 1 < 2 & 3 > 2
5
+
6
+ this &lt;&gt; that
7
+
8
+ {{ref}}
9
+
10
+ {{}}
11
+
12
+ {{ }}
13
+
14
+ {{ref|attr1}}
15
+
16
+ {{ref|attr1|attr2|attr3}}
17
+
18
+ {{ref with spaces|attr1 with spaces}}
19
+
20
+ {{NS:ref}}
21
+
22
+ {{NS:ref|attr}}
23
+
24
+ {{NS: ref}}
25
+
26
+ {{NS: ref|attr}}
27
+
28
+ {{ref|{{inner}}}}
29
+
30
+ {{ref|{{inner}}|{{inner2}}}}
31
+
32
+ {{ref|{{inner|{{subinner}}}}}}
data/test/data/input13 ADDED
@@ -0,0 +1,10 @@
1
+ __TOC__
2
+
3
+ = Headline1 =
4
+ == Sub Headline 1a ==
5
+ == Sub Headline 1b ==
6
+ = Headline2 =
7
+ == Sub Headline 2a ==
8
+ === Sub Sub Headline <i>2i</i> ===
9
+ === Sub Sub Headline '''2ii''' ===
10
+ == Sub Headline 2b ==
data/test/data/input14 ADDED
@@ -0,0 +1,8 @@
1
+ = Headline1 =
2
+ <pre>Something</pre>
3
+
4
+ == Headline2 ==
5
+ <pre>Something</pre>
6
+
7
+ == Headline3 ==
8
+ <pre>Something</pre>
data/test/data/input15 ADDED
@@ -0,0 +1,10 @@
1
+ __TOC__
2
+
3
+ == Headline1 ==
4
+ === Sub Headline 1a ===
5
+ === Sub Headline 1b ===
6
+ == Headline2 ==
7
+ === Sub Headline 2a ===
8
+ ==== Sub Sub Headline <i>2i</i> ====
9
+ ==== Sub Sub Headline '''2ii''' ====
10
+ === Sub Headline 2b ===
data/test/data/input16 ADDED
@@ -0,0 +1,28 @@
1
+ == Section ==
2
+ Some text.
3
+
4
+ <?xml version="1.0" encoding="UTF-8"?>
5
+ <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
6
+ <plist version="1.0">
7
+ <dict>
8
+ <key>Label</key>
9
+ <string>Update svn repo</string>
10
+ <key>ProgramArguments</key>
11
+ <array>
12
+ <string>updatesvn.sh</string>
13
+ </array>
14
+ <key>StandardErrorPath</key>
15
+ <string>/dev/null</string>
16
+ <key>StandardOutPath</key>
17
+ <string>/dev/null</string>
18
+ <key>StartCalendarInterval</key>
19
+ <dict>
20
+ <key>Hour</key>
21
+ <integer>16</integer>
22
+ <key>Minute</key>
23
+ <integer>40</integer>
24
+ </dict>
25
+ </dict>
26
+ </plist>
27
+
28
+ Some text.<br>Some other text.<br/>Foo.<hr><img src="foo">
data/test/data/input17 ADDED
@@ -0,0 +1,10 @@
1
+ {|
2
+ | foo
3
+ bar
4
+ zee
5
+ | moo
6
+ goo
7
+ | attr="value" otherattr="othervalue" | nah
8
+ mah
9
+ bah
10
+ |}
data/test/data/input18 ADDED
@@ -0,0 +1,16 @@
1
+ == Foobar ==
2
+ {|border="1px"
3
+ !test
4
+ |-
5
+ |a
6
+ |}
7
+
8
+ == Foobar ==
9
+ <table border="1px">
10
+ <thead>
11
+ <tr><th>test</th></tr>
12
+ </thead>
13
+ <tbody>
14
+ <tr><td>a</td></tr>
15
+ </tbody>
16
+ </table>
data/test/data/input19 ADDED
@@ -0,0 +1,29 @@
1
+ <pre>
2
+ foo bar
3
+ </pre>
4
+
5
+ <code>
6
+ foo bar
7
+ </code>
8
+
9
+ <p> hi <br/> bye</p>
10
+
11
+ <nowiki>test <br/> test</nowiki>
12
+
13
+ There's something important in this example: <code>int a = '''2'''+2;</code> but I don't know what.
14
+
15
+
16
+ There's something important in this example: <code>int a = 2+2;<br/>
17
+
18
+ int b = a + 2;
19
+ </code> but I don't know what.
20
+
21
+ <pre>
22
+ Here's some code:
23
+
24
+ <code>
25
+ int a = 2+2;
26
+
27
+ int b = 3+4;
28
+ </code>
29
+ </pre>
data/test/data/input20 ADDED
@@ -0,0 +1,8 @@
1
+ {| border="1" cellpadding="2" cellspacing="0"
2
+ | xxx
3
+ |
4
+ test
5
+ test
6
+ test
7
+ | yyy
8
+ |}
data/test/data/input21 ADDED
@@ -0,0 +1,18 @@
1
+ <paste>
2
+ This is '''some''' text pasted from anywhere
3
+ with
4
+ new
5
+ lines
6
+ and multiple spaces and tabs
7
+ and space
8
+ and two spaces
9
+ with some
10
+ <p attr="xxx" moo="zzz" bar=zzzzz>HTML formatted <a href="foo.bar">text</a> in </p> it.
11
+ </paste>
12
+ <paste></paste>
13
+ <paste/>
14
+
15
+
16
+ == Section ==
17
+
18
+ <paste>Foo</paste>