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/lib/mediacloth.rb CHANGED
@@ -4,20 +4,43 @@ require 'mediacloth/mediawikiast'
4
4
  require 'mediacloth/mediawikiparams'
5
5
  require 'mediacloth/mediawikiwalker'
6
6
  require 'mediacloth/mediawikihtmlgenerator'
7
+ require 'mediacloth/mediawikisignedwikigenerator'
8
+ require 'mediacloth/mediawikilinkhandler'
9
+ require 'mediacloth/mediawikitemplatehandler'
7
10
 
8
11
  #Helper module to facilitate MediaCloth usage.
9
12
  module MediaCloth
10
13
 
11
- #Parses wiki formatted +input+ and generates its html representation.
12
- def wiki_to_html(input)
13
- parser = MediaWikiParser.new
14
- parser.lexer = MediaWikiLexer.new
15
- ast = parser.parse(input)
16
- walker = MediaWikiHTMLGenerator.new
17
- walker.parse(ast)
18
- walker.html
19
- end
14
+ #Parses wiki formatted +input+ and generates its HTML representation.
15
+ #
16
+ #Can reveive options for customizing the HTML renderer and link_handler. These
17
+ #are the available options:
18
+ # :generator => An HTML generator (see MediaWikiHTMLGenerator)
19
+ # :link_handler => A link handler (see MediaWikiLinkHandler)
20
+ # :template_handler => A template inclusion handler (see MediaWikiTemplateHandler)
21
+ def wiki_to_html(input, options={})
22
+ parser = MediaWikiParser.new
23
+ parser.lexer = MediaWikiLexer.new
24
+ tree = parser.parse(input)
25
+ generator = options[:generator] || MediaWikiHTMLGenerator.new
26
+ generator.link_handler = options[:link_handler] if options[:link_handler]
27
+ generator.template_handler = options[:template_handler] if options[:template_handler]
28
+ generator.params = options[:params] if options[:params]
29
+ generator.parse(tree)
30
+ end
20
31
 
21
- module_function :wiki_to_html
32
+ def wiki_to_signed_wiki(input, options={})
33
+ parser = MediaWikiParser.new
34
+ parser.lexer = MediaWikiLexer.new
35
+ tree = parser.parse(input)
36
+ generator = MediaWikiSignedWikiGenerator.new
37
+ generator.link_handler = options[:link_handler] if options[:link_handler]
38
+ generator.template_handler = options[:template_handler] if options[:template_handler]
39
+ generator.params = options[:params] if options[:params]
40
+ generator.parse(tree, input)
41
+ generator.signed_wiki
42
+ end
43
+
44
+ module_function :wiki_to_html, :wiki_to_signed_wiki
22
45
 
23
46
  end
data/test/data/ast1 ADDED
@@ -0,0 +1,68 @@
1
+ WikiAST[0, 746]
2
+ ParagraphAST[0, 119]
3
+ TextAST[0, 27]: None
4
+ FormattedAST[27, 15]
5
+ TextAST[30, 9]: None
6
+ TextAST[42, 5]: None
7
+ FormattedAST[47, 15]
8
+ TextAST[49, 11]: None
9
+ TextAST[62, 57]: None
10
+ ParagraphAST[119, 46]
11
+ TextAST[119, 46]: None
12
+ ParagraphAST[165, 15]
13
+ TextAST[165, 15]: None
14
+ ParagraphAST[180, 81]
15
+ TextAST[180, 18]: None
16
+ InternalLinkAST[198, 17]
17
+ TextAST[215, 5]: None
18
+ LinkAST[220, 38]
19
+ TextAST[244, 13]: None
20
+ TextAST[258, 3]: None
21
+ ParagraphAST[261, 38]
22
+ LinkAST[261, 36]
23
+ TextAST[297, 2]: None
24
+ ParagraphAST[299, 25]
25
+ TextAST[299, 24]: None
26
+ SectionAST[324, 14]
27
+ TextAST[325, 11]: None
28
+ SectionAST[338, 16]
29
+ TextAST[340, 11]: None
30
+ SectionAST[354, 18]
31
+ TextAST[357, 11]: None
32
+ SectionAST[372, 20]
33
+ TextAST[376, 11]: None
34
+ SectionAST[392, 22]
35
+ TextAST[397, 11]: None
36
+ SectionAST[414, 24]
37
+ TextAST[420, 11]: None
38
+ SectionAST[438, 18]
39
+ TextAST[445, 11]: None
40
+ ParagraphAST[456, 41]
41
+ TextAST[464, 33]: None
42
+ SectionAST[497, 40]
43
+ TextAST[498, 5]: None
44
+ InternalLinkAST[503, 17]
45
+ TextAST[520, 15]: None
46
+ SectionAST[537, 42]
47
+ TextAST[539, 12]: None
48
+ FormattedAST[551, 15]
49
+ TextAST[554, 9]: None
50
+ TextAST[566, 9]: None
51
+ PreformattedAST[579, 52]
52
+ TextAST[579, 24]: None
53
+ FormattedAST[603, 7]
54
+ TextAST[606, 1]: None
55
+ TextAST[610, 4]: None
56
+ FormattedAST[614, 5]
57
+ TextAST[616, 1]: None
58
+ TextAST[619, 11]: None
59
+ TextAST[631, 4]: HLine
60
+ ParagraphAST[635, 33]
61
+ TextAST[635, 33]: None
62
+ ListAST[668, 13]: ListAST
63
+ ListItemAST[668, 5]
64
+ TextAST[669, 4]: None
65
+ ListItemAST[673, 7]
66
+ TextAST[674, 6]: None
67
+ SectionAST[681, 65]
68
+ TextAST[683, 61]: None
data/test/data/ast10 ADDED
@@ -0,0 +1,196 @@
1
+ WikiAST[0, 665]
2
+ ParagraphAST[0, 26]
3
+ TextAST[0, 26]: None
4
+ TableAST[26, 7]
5
+ TableAST[33, 10]
6
+ TableRowAST[33, 10]
7
+ TableAST[43, 15]
8
+ TableRowAST[43, 15]
9
+ TableCellAST[46, 8]
10
+ TextAST[47, 3]: None
11
+ TableCellAST[46, 8]
12
+ TextAST[51, 3]: None
13
+ TableAST[58, 26]
14
+ TableRowAST[58, 26]
15
+ TableCellAST[61, 8]
16
+ TextAST[62, 3]: None
17
+ TableCellAST[61, 8]
18
+ TextAST[66, 3]: None
19
+ TableRowAST[58, 26]
20
+ TableCellAST[69, 11]
21
+ TextAST[73, 3]: None
22
+ TableCellAST[69, 11]
23
+ TextAST[77, 3]: None
24
+ TableAST[84, 28]
25
+ TableRowAST[84, 28]
26
+ TableCellAST[87, 9]
27
+ TextAST[88, 3]: None
28
+ TableCellAST[87, 9]
29
+ TextAST[93, 3]: None
30
+ TableRowAST[84, 28]
31
+ TableCellAST[96, 12]
32
+ TextAST[100, 3]: None
33
+ TableCellAST[96, 12]
34
+ TextAST[105, 3]: None
35
+ TableAST[112, 26]
36
+ TableRowAST[112, 26]
37
+ TableCellAST[115, 8]
38
+ TextAST[116, 3]: None
39
+ TableCellAST[115, 8]
40
+ TextAST[120, 3]: None
41
+ TableRowAST[112, 26]
42
+ TableCellAST[123, 11]
43
+ TextAST[127, 3]: None
44
+ TableCellAST[123, 11]
45
+ TextAST[131, 3]: None
46
+ TableAST[138, 28]
47
+ TableRowAST[138, 28]
48
+ TableCellAST[141, 9]
49
+ TextAST[142, 3]: None
50
+ TableCellAST[141, 9]
51
+ TextAST[147, 3]: None
52
+ TableRowAST[138, 28]
53
+ TableCellAST[150, 12]
54
+ TextAST[154, 3]: None
55
+ TableCellAST[150, 12]
56
+ TextAST[159, 3]: None
57
+ TableAST[166, 22]
58
+ TableRowAST[166, 22]
59
+ TableCellAST[169, 4]
60
+ TextAST[170, 3]: None
61
+ TableRowAST[166, 22]
62
+ TableCellAST[173, 11]
63
+ TextAST[177, 3]: None
64
+ TableCellAST[173, 11]
65
+ TextAST[181, 3]: None
66
+ TableAST[188, 22]
67
+ TableRowAST[188, 22]
68
+ TableCellAST[191, 8]
69
+ TextAST[192, 3]: None
70
+ TableCellAST[191, 8]
71
+ TextAST[196, 3]: None
72
+ TableRowAST[188, 22]
73
+ TableCellAST[199, 7]
74
+ TextAST[203, 3]: None
75
+ TableAST[210, 24]
76
+ TableRowAST[210, 24]
77
+ TableCellAST[213, 8]
78
+ TextAST[214, 3]: None
79
+ TableCellAST[213, 8]
80
+ TextAST[218, 3]: None
81
+ TableRowAST[210, 24]
82
+ TableCellAST[221, 9]
83
+ TableCellAST[221, 9]
84
+ TextAST[227, 3]: None
85
+ TableAST[234, 106]
86
+ TableRowAST[234, 106]
87
+ TableCellAST[237, 44]
88
+ TextAST[238, 1]: None
89
+ LinkAST[239, 29]
90
+ TextAST[259, 7]: None
91
+ TableCellAST[237, 44]
92
+ TextAST[269, 1]: None
93
+ FormattedAST[270, 11]
94
+ TextAST[273, 4]: None
95
+ TableRowAST[234, 106]
96
+ TableCellAST[281, 55]
97
+ TextAST[285, 1]: None
98
+ InternalLinkAST[286, 20]
99
+ TextAST[296, 7]
100
+ TableCellAST[281, 55]
101
+ TextAST[307, 1]: None
102
+ ResourceLinkAST[308, 28]
103
+ InternalLinkItemAST[308, 28]
104
+ TextAST[328, 1]: None
105
+ InternalLinkItemAST[308, 28]
106
+ TextAST[330, 1]: None
107
+ InternalLinkItemAST[308, 28]
108
+ TextAST[332, 1]: None
109
+ TableAST[340, 89]
110
+ TableRowAST[340, 89]
111
+ TableCellAST[343, 40]
112
+ TextAST[344, 1]: None
113
+ LinkAST[345, 28]
114
+ TextAST[365, 7]: None
115
+ TableCellAST[343, 40]
116
+ TextAST[374, 1]: None
117
+ FormattedAST[375, 8]
118
+ TextAST[378, 5]: None
119
+ TableRowAST[340, 89]
120
+ TableCellAST[383, 42]
121
+ TextAST[387, 1]: None
122
+ InternalLinkAST[388, 18]
123
+ TextAST[398, 7]
124
+ TableCellAST[383, 42]
125
+ TextAST[407, 1]: None
126
+ FormattedAST[408, 17]
127
+ TextAST[411, 5]: None
128
+ FormattedAST[416, 9]
129
+ TextAST[418, 7]: None
130
+ TableAST[429, 50]
131
+ TableRowAST[429, 50]
132
+ TableCellAST[432, 8]
133
+ TextAST[433, 3]: None
134
+ TableCellAST[432, 8]
135
+ TextAST[437, 3]: None
136
+ TableRowAST[429, 50]
137
+ TableCellAST[440, 35]
138
+ TextAST[444, 19]: None
139
+ ListAST[463, 12]: ListAST
140
+ ListItemAST[463, 6]
141
+ TextAST[464, 5]: None
142
+ ListItemAST[469, 6]
143
+ TextAST[470, 5]: None
144
+ TableAST[479, 64]
145
+ TableRowAST[479, 64]
146
+ TableCellAST[482, 8]
147
+ TextAST[483, 3]: None
148
+ TableCellAST[482, 8]
149
+ TextAST[487, 3]: None
150
+ TableRowAST[479, 64]
151
+ TableCellAST[490, 53]
152
+ TextAST[494, 20]: None
153
+ TableAST[514, 29]
154
+ TableRowAST[514, 29]
155
+ TableCellAST[517, 8]
156
+ TextAST[518, 3]: None
157
+ TableCellAST[517, 8]
158
+ TextAST[522, 3]: None
159
+ TableRowAST[514, 29]
160
+ TableCellAST[525, 15]
161
+ TextAST[529, 5]: None
162
+ TableCellAST[525, 15]
163
+ TextAST[535, 5]: None
164
+ ParagraphAST[543, 5]
165
+ TextAST[546, 2]: None
166
+ TableAST[548, 46]
167
+ TableRowAST[548, 46]
168
+ TableCellAST[562, 8]
169
+ TextAST[563, 3]: None
170
+ TableCellAST[562, 8]
171
+ TextAST[567, 3]: None
172
+ TableRowAST[548, 46]
173
+ TableCellAST[570, 24]
174
+ TextAST[587, 3]: None
175
+ TableCellAST[570, 24]
176
+ TextAST[591, 3]: None
177
+ ParagraphAST[594, 5]
178
+ TextAST[597, 2]: None
179
+ ParagraphAST[599, 12]
180
+ TextAST[599, 12]: None
181
+ TableAST[611, 11]
182
+ TableRowAST[611, 11]
183
+ TableCellAST[614, 8]
184
+ TextAST[615, 3]: None
185
+ TableCellAST[614, 8]
186
+ TextAST[619, 3]: None
187
+ ParagraphAST[622, 30]
188
+ TextAST[625, 18]: None
189
+ FormattedAST[643, 9]
190
+ TextAST[645, 7]: None
191
+ TableAST[652, 13]
192
+ TableRowAST[652, 13]
193
+ TableCellAST[655, 8]
194
+ TextAST[656, 3]: None
195
+ TableCellAST[655, 8]
196
+ TextAST[660, 3]: None
data/test/data/ast11 ADDED
@@ -0,0 +1,34 @@
1
+ WikiAST[0, 342]
2
+ SectionAST[0, 57]
3
+ TextAST[2, 55]: None
4
+ ParagraphAST[57, 37]
5
+ TextAST[60, 11]: None
6
+ ElementAST[71, 20]
7
+ TextAST[75, 11]: None
8
+ TextAST[91, 3]: None
9
+ ParagraphAST[94, 128]
10
+ TextAST[94, 8]: None
11
+ ElementAST[102, 33]
12
+ TextAST[119, 11]: None
13
+ TextAST[135, 10]: None
14
+ ElementAST[145, 33]
15
+ TextAST[162, 11]: None
16
+ TextAST[178, 10]: None
17
+ ElementAST[188, 31]
18
+ TextAST[203, 11]: None
19
+ TextAST[219, 3]: None
20
+ ParagraphAST[222, 56]
21
+ TextAST[222, 39]: None
22
+ ParagraphAST[278, 12]
23
+ TextAST[278, 12]: None
24
+ PreformattedAST[290, 16]
25
+ TextAST[290, 16]: None
26
+ ParagraphAST[306, 17]
27
+ TextAST[306, 17]: None
28
+ ListAST[323, 36]: ListAST
29
+ ListItemAST[323, 6]
30
+ TextAST[324, 5]: None
31
+ ListItemAST[329, 30]
32
+ TextAST[330, 5]: None
33
+ ElementAST[335, 24]
34
+ TextAST[341, 11]: None
data/test/data/ast12 ADDED
@@ -0,0 +1,39 @@
1
+ WikiAST[0, 327]
2
+ ParagraphAST[0, 65]
3
+ TextAST[0, 4]: None
4
+ TextAST[4, 5]: CharacterEntity
5
+ TextAST[9, 7]: None
6
+ TextAST[16, 4]: CharacterEntity
7
+ TextAST[20, 3]: None
8
+ TextAST[23, 4]: CharacterEntity
9
+ TextAST[27, 38]: None
10
+ ParagraphAST[65, 20]
11
+ TextAST[65, 5]: None
12
+ TextAST[70, 4]: CharacterEntity
13
+ TextAST[74, 4]: CharacterEntity
14
+ TextAST[78, 7]: None
15
+ ParagraphAST[85, 9]
16
+ TextAST[92, 2]: None
17
+ ParagraphAST[94, 6]
18
+ TextAST[94, 6]: None
19
+ ParagraphAST[100, 7]
20
+ TextAST[105, 2]: None
21
+ ParagraphAST[107, 15]
22
+ TextAST[120, 2]: None
23
+ ParagraphAST[122, 27]
24
+ TextAST[147, 2]: None
25
+ ParagraphAST[149, 39]
26
+ TextAST[186, 2]: None
27
+ ParagraphAST[188, 12]
28
+ TextAST[198, 2]: None
29
+ ParagraphAST[200, 17]
30
+ TextAST[215, 2]: None
31
+ ParagraphAST[217, 13]
32
+ TextAST[228, 2]: None
33
+ ParagraphAST[230, 18]
34
+ TextAST[246, 2]: None
35
+ ParagraphAST[248, 19]
36
+ TextAST[265, 2]: None
37
+ ParagraphAST[267, 30]
38
+ TextAST[295, 2]: None
39
+ ParagraphAST[297, 30]
data/test/data/ast13 ADDED
@@ -0,0 +1,25 @@
1
+ WikiAST[0, 194]
2
+ ParagraphAST[7, 2]
3
+ TextAST[7, 2]: None
4
+ SectionAST[9, 14]
5
+ TextAST[10, 11]: None
6
+ SectionAST[23, 22]
7
+ TextAST[25, 17]: None
8
+ SectionAST[45, 22]
9
+ TextAST[47, 17]: None
10
+ SectionAST[67, 14]
11
+ TextAST[68, 11]: None
12
+ SectionAST[81, 22]
13
+ TextAST[83, 17]: None
14
+ SectionAST[103, 35]
15
+ TextAST[106, 18]: None
16
+ ElementAST[124, 9]
17
+ TextAST[127, 2]: None
18
+ TextAST[133, 1]: None
19
+ SectionAST[138, 35]
20
+ TextAST[141, 18]: None
21
+ FormattedAST[159, 9]
22
+ TextAST[162, 3]: None
23
+ TextAST[168, 1]: None
24
+ SectionAST[173, 21]
25
+ TextAST[175, 17]: None
data/test/data/ast14 ADDED
@@ -0,0 +1,13 @@
1
+ WikiAST[0, 111]
2
+ SectionAST[0, 14]
3
+ TextAST[1, 11]: None
4
+ ElementAST[14, 22]
5
+ TextAST[19, 9]: None
6
+ SectionAST[36, 16]
7
+ TextAST[38, 11]: None
8
+ ElementAST[52, 22]
9
+ TextAST[57, 9]: None
10
+ SectionAST[74, 16]
11
+ TextAST[76, 11]: None
12
+ ElementAST[90, 21]
13
+ TextAST[95, 9]: None
data/test/data/ast15 ADDED
@@ -0,0 +1,25 @@
1
+ WikiAST[0, 211]
2
+ ParagraphAST[7, 2]
3
+ TextAST[7, 2]: None
4
+ SectionAST[9, 16]
5
+ TextAST[11, 11]: None
6
+ SectionAST[25, 24]
7
+ TextAST[28, 17]: None
8
+ SectionAST[49, 24]
9
+ TextAST[52, 17]: None
10
+ SectionAST[73, 16]
11
+ TextAST[75, 11]: None
12
+ SectionAST[89, 24]
13
+ TextAST[92, 17]: None
14
+ SectionAST[113, 37]
15
+ TextAST[117, 18]: None
16
+ ElementAST[135, 9]
17
+ TextAST[138, 2]: None
18
+ TextAST[144, 1]: None
19
+ SectionAST[150, 37]
20
+ TextAST[154, 18]: None
21
+ FormattedAST[172, 9]
22
+ TextAST[175, 3]: None
23
+ TextAST[181, 1]: None
24
+ SectionAST[187, 24]
25
+ TextAST[190, 17]: None
data/test/data/ast16 ADDED
@@ -0,0 +1,17 @@
1
+ WikiAST[0, 667]
2
+ SectionAST[0, 11]
3
+ TextAST[2, 9]: None
4
+ ParagraphAST[11, 15]
5
+ TextAST[14, 12]: None
6
+ PreformattedAST[26, 581]
7
+ TextAST[26, 104]: None
8
+ LinkAST[130, 46]
9
+ TextAST[176, 431]: None
10
+ ParagraphAST[607, 60]
11
+ TextAST[607, 11]: None
12
+ ElementAST[618, 4]
13
+ TextAST[622, 16]: None
14
+ ElementAST[638, 5]
15
+ TextAST[643, 4]: None
16
+ ElementAST[647, 4]
17
+ ElementAST[651, 16]
data/test/data/ast17 ADDED
@@ -0,0 +1,9 @@
1
+ WikiAST[0, 82]
2
+ TableAST[0, 82]
3
+ TableRowAST[0, 82]
4
+ TableCellAST[3, 76]
5
+ TextAST[4, 13]: None
6
+ TableCellAST[3, 76]
7
+ TextAST[18, 9]: None
8
+ TableCellAST[3, 76]
9
+ TextAST[66, 13]: None
data/test/data/ast18 ADDED
@@ -0,0 +1,21 @@
1
+ WikiAST[0, 164]
2
+ SectionAST[0, 13]
3
+ TextAST[2, 8]: None
4
+ TableAST[13, 31]
5
+ TableRowAST[13, 31]
6
+ TableCellAST[28, 6]
7
+ TextAST[29, 5]: None
8
+ TableRowAST[13, 31]
9
+ TableCellAST[34, 6]
10
+ TextAST[38, 2]: None
11
+ SectionAST[44, 13]
12
+ TextAST[46, 8]: None
13
+ ElementAST[57, 107]
14
+ ElementAST[78, 40]
15
+ ElementAST[86, 23]
16
+ ElementAST[90, 13]
17
+ TextAST[94, 4]: None
18
+ ElementAST[118, 37]
19
+ ElementAST[126, 20]
20
+ ElementAST[130, 10]
21
+ TextAST[134, 1]: None
data/test/data/ast19 ADDED
@@ -0,0 +1,32 @@
1
+ WikiAST[0, 410]
2
+ ElementAST[0, 16]
3
+ TextAST[5, 11]: None
4
+ ParagraphAST[16, 34]
5
+ ElementAST[24, 24]
6
+ TextAST[30, 11]: None
7
+ TextAST[48, 2]: None
8
+ ElementAST[50, 16]
9
+ TextAST[53, 4]: None
10
+ ElementAST[57, 5]
11
+ TextAST[62, 4]: None
12
+ ParagraphAST[66, 6]
13
+ TextAST[70, 2]: None
14
+ ParagraphAST[72, 34]
15
+ TextAST[80, 17]: None
16
+ ParagraphAST[106, 101]
17
+ TextAST[106, 45]: None
18
+ ElementAST[151, 31]
19
+ TextAST[157, 8]: None
20
+ FormattedAST[165, 7]
21
+ TextAST[168, 1]: None
22
+ TextAST[172, 3]: None
23
+ TextAST[182, 25]: None
24
+ ParagraphAST[207, 118]
25
+ TextAST[207, 46]: None
26
+ ElementAST[253, 47]
27
+ TextAST[259, 12]: None
28
+ ElementAST[271, 5]
29
+ TextAST[276, 17]: None
30
+ TextAST[300, 25]: None
31
+ ElementAST[325, 94]
32
+ TextAST[330, 82]: None
data/test/data/ast2 ADDED
@@ -0,0 +1,4 @@
1
+ WikiAST[0, 19]
2
+ TextAST[0, 4]: HLine
3
+ ParagraphAST[4, 15]
4
+ TextAST[4, 15]: None
data/test/data/ast20 ADDED
@@ -0,0 +1,10 @@
1
+ WikiAST[0, 84]
2
+ TableAST[0, 84]
3
+ TableRowAST[0, 84]
4
+ TableCellAST[46, 35]
5
+ TextAST[47, 5]: None
6
+ TableCellAST[46, 35]
7
+ PreformattedAST[54, 21]
8
+ TextAST[54, 21]: None
9
+ TableCellAST[46, 35]
10
+ TextAST[76, 5]: None
data/test/data/ast21 ADDED
@@ -0,0 +1,27 @@
1
+ WikiAST[0, 289]
2
+ PasteAST[0, 237]
3
+ TextAST[8, 44]: None
4
+ ElementAST[52, 1]
5
+ TextAST[53, 4]: None
6
+ ElementAST[57, 1]
7
+ TextAST[58, 3]: None
8
+ ElementAST[61, 1]
9
+ TextAST[62, 5]: None
10
+ ElementAST[67, 1]
11
+ TextAST[68, 34]: None
12
+ ElementAST[102, 1]
13
+ TextAST[103, 10]: None
14
+ ElementAST[113, 1]
15
+ TextAST[114, 16]: None
16
+ ElementAST[130, 1]
17
+ TextAST[131, 9]: None
18
+ ElementAST[140, 1]
19
+ TextAST[141, 87]: None
20
+ ElementAST[228, 1]
21
+ PasteAST[238, 15]
22
+ ParagraphAST[253, 12]
23
+ TextAST[253, 3]: None
24
+ SectionAST[265, 15]
25
+ TextAST[267, 9]: None
26
+ PasteAST[280, 18]
27
+ TextAST[287, 3]: None
data/test/data/ast22 ADDED
@@ -0,0 +1,22 @@
1
+ WikiAST[0, 203]
2
+ ParagraphAST[7, 2]
3
+ TextAST[7, 2]: None
4
+ ParagraphAST[9, 86]
5
+ ElementAST[9, 86]
6
+ SectionAST[15, 14]
7
+ TextAST[16, 11]: None
8
+ ElementAST[29, 37]
9
+ SectionAST[36, 22]
10
+ TextAST[38, 17]: None
11
+ SectionAST[66, 22]
12
+ TextAST[68, 17]: None
13
+ SectionAST[95, 14]
14
+ TextAST[96, 11]: None
15
+ ElementAST[109, 94]
16
+ ElementAST[117, 77]
17
+ ElementAST[122, 33]
18
+ SectionAST[127, 22]
19
+ TextAST[129, 17]: None
20
+ ElementAST[155, 33]
21
+ SectionAST[160, 22]
22
+ TextAST[162, 17]: None
data/test/data/ast23 ADDED
@@ -0,0 +1,5 @@
1
+ WikiAST[0, 83]
2
+ ElementAST[0, 47]
3
+ TextAST[5, 34]: None
4
+ PreformattedAST[47, 36]
5
+ TextAST[47, 36]: None
data/test/data/ast3 ADDED
@@ -0,0 +1,6 @@
1
+ WikiAST[0, 14]
2
+ ParagraphAST[0, 16]
3
+ TextAST[0, 2]: None
4
+ TextAST[2, 5]: SignatureDate
5
+ TextAST[7, 3]: SignatureName
6
+ TextAST[11, 4]: SignatureFull