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/ast4 ADDED
@@ -0,0 +1,122 @@
1
+ WikiAST[0, 712]
2
+ ParagraphAST[0, 44]
3
+ TextAST[0, 44]: None
4
+ ParagraphAST[44, 28]
5
+ FormattedAST[44, 26]
6
+ TextAST[46, 6]: None
7
+ FormattedAST[52, 10]
8
+ TextAST[55, 4]: None
9
+ TextAST[62, 6]: None
10
+ TextAST[70, 2]: None
11
+ ParagraphAST[72, 26]
12
+ FormattedAST[72, 24]
13
+ TextAST[75, 4]: None
14
+ FormattedAST[79, 10]
15
+ TextAST[81, 6]: None
16
+ TextAST[89, 4]: None
17
+ TextAST[96, 2]: None
18
+ ParagraphAST[98, 20]
19
+ FormattedAST[98, 18]
20
+ FormattedAST[100, 14]
21
+ TextAST[103, 8]: None
22
+ TextAST[116, 2]: None
23
+ ParagraphAST[118, 52]
24
+ FormattedAST[118, 26]
25
+ TextAST[120, 6]: None
26
+ FormattedAST[126, 10]
27
+ TextAST[129, 4]: None
28
+ TextAST[136, 6]: None
29
+ FormattedAST[144, 24]
30
+ TextAST[147, 4]: None
31
+ FormattedAST[151, 10]
32
+ TextAST[153, 6]: None
33
+ TextAST[161, 4]: None
34
+ TextAST[168, 2]: None
35
+ ParagraphAST[170, 52]
36
+ TextAST[170, 52]: None
37
+ ParagraphAST[222, 24]
38
+ FormattedAST[222, 22]
39
+ LinkAST[224, 18]
40
+ TextAST[244, 2]: None
41
+ ParagraphAST[246, 26]
42
+ FormattedAST[246, 24]
43
+ LinkAST[249, 18]
44
+ TextAST[270, 2]: None
45
+ ParagraphAST[272, 25]
46
+ FormattedAST[272, 25]
47
+ LinkAST[274, 18]
48
+ FormattedAST[292, 5]
49
+ TextAST[295, 2]: None
50
+ ParagraphAST[297, 35]
51
+ FormattedAST[297, 33]
52
+ LinkAST[300, 18]
53
+ TextAST[318, 9]: None
54
+ TextAST[330, 2]: None
55
+ ParagraphAST[332, 33]
56
+ FormattedAST[332, 31]
57
+ LinkAST[334, 18]
58
+ TextAST[352, 9]: None
59
+ TextAST[363, 2]: None
60
+ ParagraphAST[365, 44]
61
+ TextAST[365, 44]: None
62
+ ParagraphAST[409, 29]
63
+ FormattedAST[409, 24]
64
+ TextAST[411, 20]: None
65
+ TextAST[433, 5]: None
66
+ SectionAST[438, 9]
67
+ TextAST[440, 7]: None
68
+ ParagraphAST[447, 9]
69
+ TextAST[450, 6]: None
70
+ ParagraphAST[456, 31]
71
+ FormattedAST[457, 30]
72
+ TextAST[459, 20]: None
73
+ FormattedAST[479, 8]
74
+ TextAST[482, 5]: None
75
+ SectionAST[487, 9]
76
+ TextAST[489, 7]: None
77
+ ParagraphAST[496, 10]
78
+ TextAST[499, 7]: None
79
+ ParagraphAST[506, 32]
80
+ FormattedAST[507, 31]
81
+ TextAST[509, 20]: None
82
+ FormattedAST[529, 9]
83
+ TextAST[532, 6]: None
84
+ SectionAST[538, 9]
85
+ TextAST[540, 7]: None
86
+ ParagraphAST[547, 5]
87
+ TextAST[550, 2]: None
88
+ ParagraphAST[552, 6]
89
+ TextAST[552, 6]: None
90
+ ParagraphAST[558, 31]
91
+ FormattedAST[559, 30]
92
+ TextAST[561, 20]: None
93
+ FormattedAST[581, 8]
94
+ TextAST[584, 5]: None
95
+ ListAST[589, 12]: ListAST
96
+ ListItemAST[589, 6]
97
+ TextAST[590, 5]: None
98
+ ListItemAST[595, 6]
99
+ TextAST[596, 5]: None
100
+ ParagraphAST[601, 2]
101
+ TextAST[601, 2]: None
102
+ ParagraphAST[603, 31]
103
+ FormattedAST[603, 31]
104
+ TextAST[605, 20]: None
105
+ FormattedAST[625, 9]
106
+ TextAST[628, 6]: None
107
+ ParagraphAST[634, 6]
108
+ TextAST[634, 6]: None
109
+ ParagraphAST[640, 28]
110
+ TextAST[640, 28]: None
111
+ SectionAST[668, 10]
112
+ TextAST[674, 4]: None
113
+ ParagraphAST[678, 12]
114
+ TextAST[684, 6]: None
115
+ SectionAST[690, 4]
116
+ TextAST[691, 1]: None
117
+ SectionAST[694, 5]
118
+ TextAST[695, 2]: None
119
+ SectionAST[699, 6]
120
+ TextAST[701, 1]: None
121
+ SectionAST[705, 7]
122
+ TextAST[707, 2]: None
data/test/data/ast5 ADDED
@@ -0,0 +1,122 @@
1
+ WikiAST[0, 239]
2
+ ParagraphAST[0, 17]
3
+ TextAST[0, 17]: None
4
+ ListAST[17, 31]: ListAST
5
+ ListItemAST[17, 23]
6
+ TextAST[18, 2]: None
7
+ ListAST[20, 20]: ListAST
8
+ ListItemAST[20, 20]
9
+ TextAST[22, 2]: None
10
+ ListAST[24, 16]: ListAST
11
+ ListItemAST[24, 5]
12
+ TextAST[27, 2]: None
13
+ ListItemAST[29, 11]
14
+ TextAST[32, 2]: None
15
+ ListAST[34, 6]: ListAST
16
+ ListItemAST[34, 6]
17
+ TextAST[38, 2]: None
18
+ ListItemAST[40, 7]
19
+ TextAST[41, 2]: None
20
+ ListAST[43, 4]: ListAST
21
+ ListItemAST[43, 4]
22
+ TextAST[45, 2]: None
23
+ ListAST[48, 8]: ListAST
24
+ ListItemAST[48, 3]
25
+ TextAST[49, 2]: None
26
+ ListItemAST[51, 3]
27
+ TextAST[52, 2]: None
28
+ ListItemAST[54, 2]
29
+ ParagraphAST[56, 16]
30
+ TextAST[56, 16]: None
31
+ ListAST[72, 27]: ListAST
32
+ ListItemAST[72, 18]
33
+ TextAST[73, 2]: None
34
+ ListAST[75, 15]: ListAST
35
+ ListItemAST[75, 15]
36
+ TextAST[77, 2]: None
37
+ ListAST[79, 11]: ListAST
38
+ ListItemAST[79, 11]
39
+ TextAST[82, 2]: None
40
+ ListAST[84, 6]: ListAST
41
+ ListItemAST[84, 6]
42
+ TextAST[88, 2]: None
43
+ ListItemAST[90, 8]
44
+ TextAST[91, 2]: None
45
+ ListAST[93, 5]: ListAST
46
+ ListItemAST[93, 5]
47
+ TextAST[95, 3]: None
48
+ ListAST[99, 8]: ListAST
49
+ ListItemAST[99, 3]
50
+ TextAST[100, 2]: None
51
+ ListItemAST[102, 3]
52
+ TextAST[103, 2]: None
53
+ ListItemAST[105, 2]
54
+ ParagraphAST[107, 14]
55
+ TextAST[107, 14]: None
56
+ ListAST[121, 15]: ListAST
57
+ ListItemAST[121, 11]
58
+ TextAST[122, 2]: None
59
+ ListAST[124, 8]: ListAST
60
+ ListItemAST[124, 4]
61
+ TextAST[126, 2]: None
62
+ ListItemAST[128, 4]
63
+ TextAST[130, 2]: None
64
+ ListItemAST[132, 3]
65
+ TextAST[133, 2]: None
66
+ ListAST[136, 19]: ListAST
67
+ ListItemAST[136, 16]
68
+ TextAST[137, 2]: None
69
+ ListAST[139, 13]: ListAST
70
+ ListItemAST[139, 4]
71
+ TextAST[141, 2]: None
72
+ ListItemAST[143, 9]
73
+ TextAST[145, 2]: None
74
+ ListAST[147, 5]: ListAST
75
+ ListItemAST[147, 5]
76
+ TextAST[150, 2]: None
77
+ ListItemAST[152, 3]
78
+ TextAST[153, 2]: None
79
+ ParagraphAST[155, 19]
80
+ TextAST[155, 19]: None
81
+ ListAST[174, 3]: ListAST
82
+ ListTermAST[174, 3]
83
+ TextAST[175, 2]: None
84
+ ParagraphAST[177, 2]
85
+ TextAST[177, 2]: None
86
+ ListAST[179, 3]: ListAST
87
+ ListDefinitionAST[179, 3]
88
+ TextAST[180, 2]: None
89
+ ParagraphAST[182, 2]
90
+ TextAST[182, 2]: None
91
+ ListAST[184, 6]: ListAST
92
+ ListTermAST[184, 3]
93
+ TextAST[185, 2]: None
94
+ ListDefinitionAST[187, 3]
95
+ TextAST[188, 2]: None
96
+ ParagraphAST[190, 2]
97
+ TextAST[190, 2]: None
98
+ ListAST[192, 9]: ListAST
99
+ ListTermAST[192, 3]
100
+ TextAST[193, 2]: None
101
+ ListDefinitionAST[195, 3]
102
+ TextAST[196, 2]: None
103
+ ListDefinitionAST[198, 3]
104
+ TextAST[199, 2]: None
105
+ ParagraphAST[201, 2]
106
+ TextAST[201, 2]: None
107
+ ListAST[203, 6]: ListAST
108
+ ListTermAST[203, 3]
109
+ TextAST[204, 2]: None
110
+ ListDefinitionAST[206, 3]
111
+ TextAST[207, 2]: None
112
+ ListAST[209, 7]: ListAST
113
+ ListTermAST[209, 3]
114
+ TextAST[210, 2]: None
115
+ ListDefinitionAST[212, 3]
116
+ TextAST[213, 2]: None
117
+ ListAST[216, 23]: ListAST
118
+ ListTermAST[216, 3]
119
+ TextAST[217, 2]: None
120
+ ListDefinitionAST[219, 20]
121
+ TextAST[220, 2]: None
122
+ ResourceLinkAST[222, 17]
data/test/data/ast6 ADDED
@@ -0,0 +1,22 @@
1
+ WikiAST[0, 161]
2
+ ParagraphAST[0, 83]
3
+ TextAST[0, 23]: None
4
+ FormattedAST[23, 10]
5
+ TextAST[26, 4]: None
6
+ TextAST[33, 5]: None
7
+ FormattedAST[38, 10]
8
+ TextAST[40, 6]: None
9
+ TextAST[48, 35]: None
10
+ ListAST[83, 66]: ListAST
11
+ ListItemAST[83, 52]
12
+ TextAST[84, 13]: None
13
+ ListAST[97, 38]: ListAST
14
+ ListItemAST[97, 19]
15
+ TextAST[99, 17]: None
16
+ ListItemAST[116, 19]
17
+ TextAST[118, 17]: None
18
+ ListItemAST[135, 14]
19
+ TextAST[136, 13]: None
20
+ ParagraphAST[149, 8]
21
+ TextAST[149, 8]: None
22
+ TextAST[157, 4]: HLine
data/test/data/ast7 ADDED
@@ -0,0 +1,143 @@
1
+ WikiAST[0, 850]
2
+ ParagraphAST[0, 16]
3
+ LinkAST[0, 14]
4
+ TextAST[14, 2]: None
5
+ ParagraphAST[16, 19]
6
+ LinkAST[16, 17]
7
+ TextAST[33, 2]: None
8
+ ParagraphAST[35, 18]
9
+ LinkAST[35, 16]
10
+ TextAST[51, 2]: None
11
+ ParagraphAST[53, 22]
12
+ LinkAST[53, 20]
13
+ TextAST[73, 2]: None
14
+ ParagraphAST[75, 24]
15
+ LinkAST[75, 22]
16
+ TextAST[91, 5]: None
17
+ TextAST[97, 2]: None
18
+ ParagraphAST[99, 33]
19
+ LinkAST[99, 31]
20
+ TextAST[115, 14]: None
21
+ TextAST[130, 2]: None
22
+ ParagraphAST[132, 63]
23
+ LinkAST[132, 61]
24
+ TextAST[148, 10]: None
25
+ FormattedAST[158, 8]
26
+ TextAST[160, 4]: None
27
+ TextAST[166, 5]: None
28
+ FormattedAST[171, 11]
29
+ TextAST[174, 5]: None
30
+ TextAST[182, 10]: None
31
+ TextAST[193, 2]: None
32
+ ParagraphAST[195, 49]
33
+ LinkAST[195, 47]
34
+ ElementAST[211, 12]
35
+ TextAST[215, 3]: None
36
+ TextAST[223, 5]: None
37
+ ElementAST[228, 13]
38
+ TextAST[232, 4]: None
39
+ TextAST[242, 2]: None
40
+ ParagraphAST[244, 29]
41
+ LinkAST[244, 27]
42
+ TextAST[260, 10]: None
43
+ TextAST[271, 2]: None
44
+ ParagraphAST[273, 9]
45
+ InternalLinkAST[273, 7]
46
+ TextAST[280, 2]: None
47
+ ParagraphAST[282, 23]
48
+ InternalLinkAST[282, 21]
49
+ TextAST[288, 13]
50
+ TextAST[303, 2]: None
51
+ ParagraphAST[305, 29]
52
+ ResourceLinkAST[305, 27]
53
+ InternalLinkItemAST[305, 27]
54
+ TextAST[317, 13]: None
55
+ TextAST[332, 2]: None
56
+ ParagraphAST[334, 32]
57
+ InternalLinkAST[334, 30]
58
+ TextAST[340, 22]
59
+ TextAST[364, 2]: None
60
+ ParagraphAST[366, 29]
61
+ InternalLinkAST[366, 27]
62
+ TextAST[372, 19]
63
+ TextAST[393, 2]: None
64
+ ParagraphAST[395, 49]
65
+ InternalLinkAST[395, 47]
66
+ TextAST[401, 9]
67
+ ElementAST[410, 12]
68
+ TextAST[414, 3]: None
69
+ TextAST[422, 5]
70
+ ElementAST[427, 13]
71
+ TextAST[431, 4]: None
72
+ TextAST[442, 2]: None
73
+ ParagraphAST[444, 38]
74
+ ResourceLinkAST[444, 36]
75
+ InternalLinkItemAST[444, 36]
76
+ TextAST[456, 8]: None
77
+ InternalLinkItemAST[444, 36]
78
+ TextAST[465, 13]: None
79
+ TextAST[480, 2]: None
80
+ ParagraphAST[482, 33]
81
+ ResourceLinkAST[482, 31]
82
+ InternalLinkItemAST[482, 31]
83
+ TextAST[494, 10]: None
84
+ InternalLinkAST[504, 7]
85
+ TextAST[513, 2]: None
86
+ ParagraphAST[515, 44]
87
+ ResourceLinkAST[515, 42]
88
+ InternalLinkItemAST[515, 42]
89
+ TextAST[527, 10]: None
90
+ InternalLinkAST[537, 18]
91
+ TextAST[543, 10]
92
+ TextAST[557, 2]: None
93
+ ParagraphAST[559, 32]
94
+ ResourceLinkAST[559, 30]
95
+ InternalLinkItemAST[559, 30]
96
+ TextAST[571, 3]: None
97
+ InternalLinkItemAST[559, 30]
98
+ TextAST[576, 3]: None
99
+ InternalLinkItemAST[559, 30]
100
+ TextAST[581, 5]: None
101
+ TextAST[589, 2]: None
102
+ ParagraphAST[591, 66]
103
+ ResourceLinkAST[591, 64]
104
+ InternalLinkItemAST[591, 64]
105
+ TextAST[603, 3]: None
106
+ InternalLinkItemAST[591, 64]
107
+ InternalLinkAST[607, 15]
108
+ TextAST[613, 7]
109
+ InternalLinkItemAST[591, 64]
110
+ ResourceLinkAST[623, 26]
111
+ InternalLinkItemAST[623, 26]
112
+ TextAST[636, 3]: None
113
+ InternalLinkItemAST[623, 26]
114
+ TextAST[640, 3]: None
115
+ InternalLinkItemAST[623, 26]
116
+ TextAST[644, 3]: None
117
+ InternalLinkItemAST[591, 64]
118
+ TextAST[650, 3]: None
119
+ TextAST[655, 2]: None
120
+ ParagraphAST[657, 4]
121
+ TextAST[657, 4]: None
122
+ ParagraphAST[661, 5]
123
+ TextAST[661, 5]: None
124
+ ParagraphAST[666, 6]
125
+ TextAST[666, 6]: None
126
+ ParagraphAST[672, 7]
127
+ InternalLinkAST[672, 5]
128
+ TextAST[677, 2]: None
129
+ ParagraphAST[679, 23]
130
+ TextAST[700, 2]: None
131
+ ParagraphAST[702, 28]
132
+ TextAST[728, 2]: None
133
+ ParagraphAST[730, 36]
134
+ TextAST[764, 2]: None
135
+ ParagraphAST[766, 24]
136
+ CategoryLinkAST[766, 22]
137
+ TextAST[788, 2]: None
138
+ ParagraphAST[790, 29]
139
+ CategoryLinkAST[790, 27]
140
+ TextAST[817, 2]: None
141
+ ParagraphAST[819, 31]
142
+ CategoryLinkAST[819, 31]
143
+ TextAST[845, 3]
data/test/data/ast8 ADDED
@@ -0,0 +1,3 @@
1
+ WikiAST[0, 11]
2
+ SectionAST[0, 11]
3
+ TextAST[3, 5]: None
data/test/data/ast9 ADDED
@@ -0,0 +1,11 @@
1
+ WikiAST[0, 193]
2
+ ParagraphAST[0, 33]
3
+ TextAST[0, 33]: None
4
+ ParagraphAST[33, 88]
5
+ TextAST[33, 71]: None
6
+ ParagraphAST[121, 57]
7
+ TextAST[121, 40]: None
8
+ ParagraphAST[178, 28]
9
+ TextAST[178, 28]: None
10
+ SectionAST[206, 38]
11
+ TextAST[208, 16]: None
data/test/data/html1 CHANGED
@@ -1,6 +1,34 @@
1
1
  <p>This is a simple text with <b>Bold text</b> and <i>Italic text</i> inside.
2
- One paragraph can be written in several lines.</p><p>Another paragraph starts after a blank line.</p><p>
3
- Another one.</p><p>This is text with <a href="javascript:void(0)">Internal Link</a> and <a href="http://www.example.com">external link</a>.</p><p>We can have headlines:</p><h1> Headline1 </h1><h2> Headline2 </h2><h3> Headline3 </h3><h4> Headline4 </h4><h5> Headline5 </h5><h6> Headline6 </h6><h7> Headline7 </h7><p>Headlines may have formatting:</p><h1> See <a href="javascript:void(0)">Internal Link</a> for more info </h1><h2> This is an <b>important</b> heading </h2><hr></hr><p>
4
- This is a text after the line.</p><ul><li>foo
5
- </li><li>foo2
6
- </li></ul>
2
+ One paragraph can be written in several lines.
3
+
4
+ </p><p>Another paragraph starts after a blank line.
5
+
6
+ </p><p>
7
+ Another one.
8
+
9
+ </p><p>This is text with <a href="javascript:void(0)">Internal Link</a> and <a href="http://www.example.com">external link</a>.
10
+
11
+ </p><p><a href="http://inline.link/with?at@character">http://inline.link/with?at@character</a>
12
+
13
+ </p><p>We can have headlines:
14
+
15
+ </p><h1><a name='Headline1'></a> Headline1 </h1>
16
+ <h2><a name='Headline2'></a> Headline2 </h2>
17
+ <h3><a name='Headline3'></a> Headline3 </h3>
18
+ <h4><a name='Headline4'></a> Headline4 </h4>
19
+ <h5><a name='Headline5'></a> Headline5 </h5>
20
+ <h6><a name='Headline6'></a> Headline6 </h6>
21
+ <h7><a name='Headline7'></a> Headline7 </h7>
22
+ <p>
23
+ Headlines may have formatting:
24
+
25
+ </p><h1><a name='See_for_more_info'></a> See <a href="javascript:void(0)">Internal Link</a> for more info </h1>
26
+ <h2><a name='This_is_an_important_heading'></a> This is an <b>important</b> heading </h2>
27
+ <pre class="indent">This is a preformatted <b> </b> &lt;&lt; <i> </i> text
28
+ yes
29
+ </pre><hr/><p>
30
+ This is a text after the line.
31
+
32
+ </p><ul><li>foo
33
+ </li><li> foo2
34
+ </li></ul><h2><a name='There_aren_t_any_closing_quotes_inside_this_headline_s_name'></a> There aren't any closing quotes inside this headline's name </h2>
data/test/data/html10 CHANGED
@@ -1,75 +1,75 @@
1
- <p>Some examples of tables.</p><table></table>
2
- <table><tr></tr>
1
+ <p>Some examples of tables.
2
+
3
+ </p><table cellpadding="5" border="1"></table>
4
+ <table cellpadding="5" border="1"><tr></tr>
3
5
  </table>
4
- <table><tr><td> a
6
+ <table cellpadding="5" border="1"><tr><td> a
5
7
  </td><td> b
6
8
  </td></tr>
7
9
  </table>
8
- <table><tr><td> a
10
+ <table cellpadding="5" border="1"><tr><td> a
9
11
  </td><td> b
10
12
  </td></tr>
11
13
  <tr><td> 1
12
14
  </td><td> 2
13
15
  </td></tr>
14
16
  </table>
15
- <table><tr><td> a </td><td> b
17
+ <table cellpadding="5" border="1"><tr><td> a </td><td> b
16
18
  </td></tr>
17
19
  <tr><td> 1 </td><td> 2
18
20
  </td></tr>
19
21
  </table>
20
- <table><tr><th> a
22
+ <table cellpadding="5" border="1"><tr><th> a
21
23
  </th><th> b
22
24
  </th></tr>
23
25
  <tr><td> 1
24
26
  </td><td> 2
25
27
  </td></tr>
26
28
  </table>
27
- <table><tr><th> a </th><th> b
29
+ <table cellpadding="5" border="1"><tr><th> a </th><th> b
28
30
  </th></tr>
29
31
  <tr><td> 1 </td><td> 2
30
32
  </td></tr>
31
33
  </table>
32
- <table><tr><td> a
34
+ <table cellpadding="5" border="1"><tr><td> a
33
35
  </td></tr>
34
36
  <tr><td> 1
35
37
  </td><td> 2
36
38
  </td></tr>
37
39
  </table>
38
- <table><tr><td> a
40
+ <table cellpadding="5" border="1"><tr><td> a
39
41
  </td><td> b
40
42
  </td></tr>
41
43
  <tr><td> 1
42
44
  </td></tr>
43
45
  </table>
44
- <table><tr><td> a
46
+ <table cellpadding="5" border="1"><tr><td> a
45
47
  </td><td> b
46
48
  </td></tr>
47
49
  <tr><td></td><td> 2
48
50
  </td></tr>
49
51
  </table>
50
- <table><tr><td> <a href="http://example.com">Example</a></td><td> <b>bold</b></td></tr>
51
- <tr><td> <a href="javascript:void(0)">Example</a></td><td> <a href="javascript:void(0)">image:example.jpg(1, 2, 3)</a></td></tr>
52
+ <table cellpadding="5" border="1"><tr><td> <a href="http://example.com">Example</a></td><td> <b>bold</b></td></tr>
53
+ <tr><td> <a href="javascript:void(0)">Example</a></td><td> <a href="image:example.jpg">image:example.jpg</a></td></tr>
52
54
  </table>
53
- <table><tr><td> <a href="http://example.com">Example
54
- </a></td><td> <b>bold
55
+ <table cellpadding="5" border="1"><tr><td> <a href="http://example.com">Example</a></td><td> <b>bold
55
56
  </b></td></tr>
56
- <tr><td> <a href="javascript:void(0)">Example
57
- </a></td><td> <b>bold <i>italic
57
+ <tr><td> <a href="javascript:void(0)">Example</a></td><td> <b>bold <i>italic
58
58
  </i></b></td></tr>
59
59
  </table>
60
- <table><tr><td> a
60
+ <table cellpadding="5" border="1"><tr><td> a
61
61
  </td><td> b
62
62
  </td></tr>
63
63
  <tr><td> A list in a cell:
64
- <ul><li>one
65
- </li><li>two
64
+ <ul><li> one
65
+ </li><li> two
66
66
  </li></ul></td></tr>
67
67
  </table>
68
- <table><tr><td> a
68
+ <table cellpadding="5" border="1"><tr><td> a
69
69
  </td><td> b
70
70
  </td></tr>
71
71
  <tr><td> A table in a cell:
72
- <table><tr><td> 1
72
+ <table cellpadding="5" border="1"><tr><td> 1
73
73
  </td><td> 2
74
74
  </td></tr>
75
75
  <tr><td> one
@@ -78,21 +78,25 @@
78
78
  </table>
79
79
  </td></tr>
80
80
  </table>
81
- <table border="1"><tr><th> a
81
+ <p><br />
82
+
83
+ </p><table border="1" cellpadding="5"><tr><th> a
82
84
  </th><th> b
83
85
  </th></tr>
84
86
  <tr align="left"><td> 1
85
87
  </td><td> 2
86
88
  </td></tr>
87
89
  </table>
88
- <p>
89
- Text before
90
- </p><table><tr><td> a
90
+ <p><br />
91
+
92
+ </p><p>Text before
93
+ </p><table cellpadding="5" border="1"><tr><td> a
91
94
  </td><td> b
92
95
  </td></tr>
93
96
  </table>
94
- <p>Text before with <i>italic
95
- </i></p><table><tr><td> a
97
+ <p>
98
+ Text before with <i>italic
99
+ </i></p><table cellpadding="5" border="1"><tr><td> a
96
100
  </td><td> b
97
101
  </td></tr>
98
102
  </table>
data/test/data/html11 ADDED
@@ -0,0 +1,19 @@
1
+ <h2><a name='Examples_of_XHTML_markup_and_escaping_of_XML_characters'></a>Examples of XHTML markup and escaping of XML characters</h2>
2
+ <p>
3
+ Here is a <tt>code sample</tt>.
4
+
5
+ </p><p>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
+ </p><p>An example of a &lt;tt&gt;code sample&lt;/tt&gt;.
10
+
11
+ </p><p>Some math:
12
+
13
+ </p><pre class="indent">1 &lt; 2 &amp; 1 &gt; 0
14
+ </pre><p>
15
+ And more text.
16
+
17
+ </p><ul><li> one
18
+ </li><li> two <span>a b
19
+ c d e f</span></li></ul>
data/test/data/html12 ADDED
@@ -0,0 +1,32 @@
1
+ <p>one &amp; two
2
+ 1 &lt; 2
3
+ &lt;lt; is the &quot;lt&quot; symbol
4
+ 1 &lt; 2 &amp; 3 &gt; 2
5
+
6
+ </p><p>this &lt;&gt; that
7
+
8
+ </p><p>{{ref}}
9
+
10
+ </p><p>{{}}
11
+
12
+ </p><p>{{ }}
13
+
14
+ </p><p>{{ref|attr1}}
15
+
16
+ </p><p>{{ref|attr1|attr2|attr3}}
17
+
18
+ </p><p>{{ref with spaces|attr1 with spaces}}
19
+
20
+ </p><p>{{NS:ref}}
21
+
22
+ </p><p>{{NS:ref|attr}}
23
+
24
+ </p><p>{{NS: ref}}
25
+
26
+ </p><p>{{NS: ref|attr}}
27
+
28
+ </p><p>{{ref|{{inner}}}}
29
+
30
+ </p><p>{{ref|{{inner}}|{{inner2}}}}
31
+
32
+ </p><p>{{ref|{{inner|{{subinner}}}}}}</p>
data/test/data/html13 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><h1><a name='Headline1'></a> Headline1 </h1>
23
+ <h2><a name='Sub_Headline_1a'></a> Sub Headline 1a </h2>
24
+ <h2><a name='Sub_Headline_1b'></a> Sub Headline 1b </h2>
25
+ <h1><a name='Headline2'></a> Headline2 </h1>
26
+ <h2><a name='Sub_Headline_2a'></a> Sub Headline 2a </h2>
27
+ <h3><a name='Sub_Sub_Headline_2i'></a> Sub Sub Headline <i>2i</i> </h3>
28
+ <h3><a name='Sub_Sub_Headline_2ii'></a> Sub Sub Headline <b>2ii</b> </h3>
29
+ <h2><a name='Sub_Headline_2b'></a> Sub Headline 2b </h2>