maruku 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/docs/markdown_syntax.md +9 -21
  5. data/lib/maruku/defaults.rb +1 -1
  6. data/lib/maruku/element.rb +18 -3
  7. data/lib/maruku/ext/fenced_code.rb +1 -1
  8. data/lib/maruku/ext/math/mathml_engines/blahtex.rb +1 -1
  9. data/lib/maruku/ext/math/to_html.rb +2 -9
  10. data/lib/maruku/html.rb +5 -8
  11. data/lib/maruku/input/html_helper.rb +94 -81
  12. data/lib/maruku/input/mdline.rb +6 -4
  13. data/lib/maruku/input/parse_block.rb +145 -37
  14. data/lib/maruku/input/parse_span.rb +7 -8
  15. data/lib/maruku/input/rubypants.rb +22 -9
  16. data/lib/maruku/maruku.rb +5 -0
  17. data/lib/maruku/output/to_html.rb +15 -6
  18. data/lib/maruku/output/to_latex.rb +9 -3
  19. data/lib/maruku/output/to_s.rb +0 -1
  20. data/lib/maruku/string_utils.rb +2 -2
  21. data/lib/maruku/version.rb +1 -1
  22. data/spec/block_docs/abbrev.md +18 -18
  23. data/spec/block_docs/attribute_sanitize.md +22 -0
  24. data/spec/block_docs/auto_cdata.md +48 -0
  25. data/spec/block_docs/bug_table.md +4 -4
  26. data/spec/block_docs/code4.md +79 -0
  27. data/spec/block_docs/div_without_newline.md +16 -0
  28. data/spec/block_docs/empty_cells.md +3 -9
  29. data/spec/block_docs/entities.md +6 -12
  30. data/spec/block_docs/extra_table1.md +6 -6
  31. data/spec/block_docs/fenced_code_blocks.md +12 -20
  32. data/spec/block_docs/fenced_code_blocks_highlighted.md +1 -2
  33. data/spec/block_docs/footnotes2.md +4 -1
  34. data/spec/block_docs/ignore_bad_header.md +9 -0
  35. data/spec/block_docs/issue106.md +78 -0
  36. data/spec/block_docs/issue115.md +20 -0
  37. data/spec/block_docs/issue117.md +13 -0
  38. data/spec/block_docs/issue120.md +48 -0
  39. data/spec/block_docs/issue123.md +11 -0
  40. data/spec/block_docs/issue124.md +16 -0
  41. data/spec/block_docs/issue40.md +24 -12
  42. data/spec/block_docs/issue89.md +1 -1
  43. data/spec/block_docs/lists_nested_blankline.md +14 -8
  44. data/spec/block_docs/lists_ol.md +5 -5
  45. data/spec/block_docs/lists_paraindent.md +6 -11
  46. data/spec/block_docs/math-blahtex/equations.md +12 -13
  47. data/spec/block_docs/math-blahtex/math2.md +9 -2
  48. data/spec/block_docs/math/embedded_invalid_svg.md +31 -2
  49. data/spec/block_docs/math/embedded_svg.md +41 -2
  50. data/spec/block_docs/math/equations.md +7 -2
  51. data/spec/block_docs/math/inline.md +2 -2
  52. data/spec/block_docs/math/math2.md +9 -1
  53. data/spec/block_docs/math/spaces_after_inline_math.md +17 -0
  54. data/spec/block_docs/math/table.md +2 -2
  55. data/spec/block_docs/math/table2.md +6 -6
  56. data/spec/block_docs/table_attributes.md +4 -6
  57. data/spec/block_docs/table_colspan.md +41 -0
  58. data/spec/block_docs/tables.md +10 -21
  59. data/spec/block_docs/tables2.md +74 -0
  60. data/spec/block_docs/xml_comments.md +32 -0
  61. data/spec/span_spec.rb +1 -1
  62. data/spec/spec_helper.rb +1 -0
  63. metadata +42 -28
  64. metadata.gz.sig +3 -3
  65. data/spec/block_docs/xml2.md +0 -19
@@ -45,7 +45,7 @@ md_el(:document,[
45
45
  ])
46
46
  ],{},[])
47
47
  *** Output of to_html ***
48
- <p>In <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline" class="maruku-mathml"><mi>SU</mi><mo stretchy="false">(</mo><mn>3</mn><mo stretchy="false">)</mo></math>, <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline" class="maruku-mathml"><semantics><annotation-xml encoding="SVG1.1">
48
+ <p>In <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline" class="maruku-mathml"><semantics><mrow><mi>SU</mi><mo stretchy="false">(</mo><mn>3</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">SU(3)</annotation></semantics></math>, <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline" class="maruku-mathml"><semantics><mrow><semantics><annotation-xml encoding="SVG1.1">
49
49
  <svg xmlns="http://www.w3.org/2000/svg" width="30" height="16" viewBox="0 0 30 16">
50
50
  <g></g>
51
51
  </svg>
@@ -68,7 +68,36 @@ md_el(:document,[
68
68
  <rect width="10" height="10" x="20"></rect>
69
69
  </g>
70
70
  </svg>
71
- </annotation-xml></semantics></math>.</p>
71
+ </annotation-xml></semantics></mrow><annotation encoding="application/x-tex">\begin{svg}
72
+ svg xmlns=http://www.w3.org/2000/svg width=30 height=16 viewBox=0 0 30 16
73
+ g/rect
74
+ /svg
75
+ \end{svg}\includegraphics[width=2em]{young1}
76
+ \otimes
77
+ \begin{svg}
78
+ svg xmlns=http://www.w3.org/2000/svg width=20 height=16 viewBox=0 0 20 16
79
+ descFundamental Representation/desc
80
+ g
81
+ /svg
82
+ \end{svg}\includegraphics[width=1em]{young2}
83
+ =
84
+ \begin{svg}
85
+ svg xmlns=http://www.w3.org/2000/svg width=30 height=26 viewBox=0 0 30 26
86
+ descAdjoint Representation/desc
87
+ /g
88
+ /svg
89
+ \end{svg}\includegraphics[width=2em]{young3}
90
+ \oplus
91
+ \begin{svg}
92
+ svg xmlns=http://www.w3.org/2000/svg width=40 height=16 viewBox=0 0 40 16
93
+ descRank-3 Symmetric Tensor Representation/desc
94
+ g transform=translate(5,5) fill=#FCC stroke=#000 stroke-width=2
95
+ rect width=10 height=10/
96
+ rect width=10 height=10 x=10/
97
+ rect width=10 height=10 x=20/
98
+ /g
99
+ /svg
100
+ \end{svg}\includegraphics[width=3em]{young4}</annotation></semantics></math>.</p>
72
101
  *** Output of to_latex ***
73
102
  In $SU(3)$, $ \includegraphics[width=2em]{young1}
74
103
  \otimes
@@ -53,7 +53,7 @@ md_el(:document,[
53
53
  ])
54
54
  ],{},[])
55
55
  *** Output of to_html ***
56
- <p>In <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline" class="maruku-mathml"><mi>SU</mi><mo stretchy="false">(</mo><mn>3</mn><mo stretchy="false">)</mo></math>, <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline" class="maruku-mathml"><semantics><annotation-xml encoding="SVG1.1">
56
+ <p>In <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline" class="maruku-mathml"><semantics><mrow><mi>SU</mi><mo stretchy="false">(</mo><mn>3</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">SU(3)</annotation></semantics></math>, <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline" class="maruku-mathml"><semantics><mrow><semantics><annotation-xml encoding="SVG1.1">
57
57
  <svg xmlns="http://www.w3.org/2000/svg" width="30" height="16" viewBox="0 0 30 16">
58
58
  <desc>Rank-2 Symmetric Tensor Representation</desc>
59
59
  <g transform="translate(5,5)" fill="#FCC" stroke="#000" stroke-width="2">
@@ -86,7 +86,46 @@ md_el(:document,[
86
86
  <rect width="10" height="10" x="20"></rect>
87
87
  </g>
88
88
  </svg>
89
- </annotation-xml></semantics></math>.</p>
89
+ </annotation-xml></semantics></mrow><annotation encoding="application/x-tex">\begin{svg}
90
+ &lt;svg xmlns="http://www.w3.org/2000/svg" width="30" height="16" viewBox="0 0 30 16"&gt;
91
+ &lt;desc&gt;Rank-2 Symmetric Tensor Representation&lt;/desc&gt;
92
+ &lt;g transform="translate(5,5)" fill="#FCC" stroke="#000" stroke-width="2"&gt;
93
+ &lt;rect width="10" height="10"/&gt;
94
+ &lt;rect width="10" height="10" x="10"/&gt;
95
+ &lt;/g&gt;
96
+ &lt;/svg&gt;
97
+ \end{svg}\includegraphics[width=2em]{young1}
98
+ \otimes
99
+ \begin{svg}
100
+ &lt;svg xmlns="http://www.w3.org/2000/svg" width="20" height="16" viewBox="0 0 20 16"&gt;
101
+ &lt;desc&gt;Fundamental Representation&lt;/desc&gt;
102
+ &lt;g transform="translate(5,5)" fill="#FCC" stroke="#000" stroke-width="2"&gt;
103
+ &lt;rect width="10" height="10"/&gt;
104
+ &lt;/g&gt;
105
+ &lt;/svg&gt;
106
+ \end{svg}\includegraphics[width=1em]{young2}
107
+ =
108
+ \begin{svg}
109
+ &lt;svg xmlns="http://www.w3.org/2000/svg" width="30" height="26" viewBox="0 0 30 26"&gt;
110
+ &lt;desc&gt;Adjoint Representation&lt;/desc&gt;
111
+ &lt;g transform="translate(5,5)" fill="#FCC" stroke="#000" stroke-width="2"&gt;
112
+ &lt;rect width="10" height="10"/&gt;
113
+ &lt;rect width="10" height="10" x="10"/&gt;
114
+ &lt;rect width="10" height="10" y="10"/&gt;
115
+ &lt;/g&gt;
116
+ &lt;/svg&gt;
117
+ \end{svg}\includegraphics[width=2em]{young3}
118
+ \oplus
119
+ \begin{svg}
120
+ &lt;svg xmlns="http://www.w3.org/2000/svg" width="40" height="16" viewBox="0 0 40 16"&gt;
121
+ &lt;desc&gt;Rank-3 Symmetric Tensor Representation&lt;/desc&gt;
122
+ &lt;g transform="translate(5,5)" fill="#FCC" stroke="#000" stroke-width="2"&gt;
123
+ &lt;rect width="10" height="10"/&gt;
124
+ &lt;rect width="10" height="10" x="10"/&gt;
125
+ &lt;rect width="10" height="10" x="20"/&gt;
126
+ &lt;/g&gt;
127
+ &lt;/svg&gt;
128
+ \end{svg}\includegraphics[width=3em]{young4}</annotation></semantics></math>.</p>
90
129
  *** Output of to_latex ***
91
130
  In $SU(3)$, $ \includegraphics[width=2em]{young1}
92
131
  \otimes
@@ -22,8 +22,13 @@ md_el(:document,[
22
22
  md_el(:equation,[],{:label=>nil,:math=>" x = y \n\n",:num=>nil},[])
23
23
  ],{},[])
24
24
  *** Output of to_html ***
25
- <div class="maruku-equation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="maruku-mathml"><mi>x</mi><mo>=</mo><mi>y</mi></math><span class="maruku-eq-tex"><code style="display: none">x = y</code></span></div><div class="maruku-equation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="maruku-mathml"><mi>x</mi><mo>=</mo><mi>y</mi></math><span class="maruku-eq-tex"><code style="display: none">x
26
- = y</code></span></div><div class="maruku-equation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="maruku-mathml"><mi>x</mi><mo>=</mo><mi>y</mi></math><span class="maruku-eq-tex"><code style="display: none">x = y</code></span></div><div class="maruku-equation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="maruku-mathml"><mi>x</mi><mo>=</mo><mi>y</mi></math><span class="maruku-eq-tex"><code style="display: none">x = y</code></span></div>
25
+ <div class="maruku-equation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="maruku-mathml"><semantics><mrow><mi>x</mi><mo>=</mo><mi>y</mi></mrow><annotation encoding="application/x-tex"> x = y </annotation></semantics></math></div><div class="maruku-equation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="maruku-mathml"><semantics><mrow><mi>x</mi><mo>=</mo><mi>y</mi></mrow><annotation encoding="application/x-tex"> x
26
+ = y
27
+ </annotation></semantics></math></div><div class="maruku-equation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="maruku-mathml"><semantics><mrow><mi>x</mi><mo>=</mo><mi>y</mi></mrow><annotation encoding="application/x-tex">
28
+ x = y
29
+ </annotation></semantics></math></div><div class="maruku-equation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="maruku-mathml"><semantics><mrow><mi>x</mi><mo>=</mo><mi>y</mi></mrow><annotation encoding="application/x-tex"> x = y
30
+
31
+ </annotation></semantics></math></div>
27
32
  *** Output of to_latex ***
28
33
  \begin{displaymath}
29
34
  x = y
@@ -22,9 +22,9 @@ md_el(:document,[
22
22
  <p>Here are some formulas:</p>
23
23
 
24
24
  <ul>
25
- <li><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline" class="maruku-mathml"><mi>α</mi></math></li>
25
+ <li><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline" class="maruku-mathml"><semantics><mrow><mi>α</mi></mrow><annotation encoding="application/x-tex">\alpha</annotation></semantics></math></li>
26
26
 
27
- <li><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline" class="maruku-mathml"><msup><mi>x</mi> <mi>n</mi></msup><mo>+</mo><msup><mi>y</mi> <mi>n</mi></msup><mo>≠</mo><msup><mi>z</mi> <mi>n</mi></msup></math></li>
27
+ <li><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline" class="maruku-mathml"><semantics><mrow><msup><mi>x</mi> <mi>n</mi></msup><mo>+</mo><msup><mi>y</mi> <mi>n</mi></msup><mo>≠</mo><msup><mi>z</mi> <mi>n</mi></msup></mrow><annotation encoding="application/x-tex">x^{n}+y^{n} \neq z^{n}</annotation></semantics></math></li>
28
28
  </ul>
29
29
 
30
30
  <p>That’s it, nothing else is supported.</p>
@@ -25,7 +25,15 @@ md_el(:document,[
25
25
  md_el(:equation,[],{:label=>nil,:math=>" \\gamma ",:num=>nil},[])
26
26
  ],{},[])
27
27
  *** Output of to_html ***
28
- <div class="maruku-equation" id="eq:eq1"><span class="maruku-eq-number">(1)</span><math xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="maruku-mathml"><mi>α</mi></math><span class="maruku-eq-tex"><code style="display: none">\alpha</code></span></div><div class="maruku-equation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="maruku-mathml"><mi>α</mi></math><span class="maruku-eq-tex"><code style="display: none">\alpha</code></span></div><div class="maruku-equation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="maruku-mathml"><mi>β</mi></math><span class="maruku-eq-tex"><code style="display: none">\beta</code></span></div><div class="maruku-equation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="maruku-mathml"><mi>γ</mi></math><span class="maruku-eq-tex"><code style="display: none">\gamma</code></span></div>
28
+ <div class="maruku-equation" id="eq:eq1"><span class="maruku-eq-number">(1)</span><math xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="maruku-mathml"><semantics><mrow><mi>α</mi></mrow><annotation encoding="application/x-tex">
29
+ \alpha
30
+
31
+ </annotation></semantics></math></div><div class="maruku-equation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="maruku-mathml"><semantics><mrow><mi>α</mi></mrow><annotation encoding="application/x-tex">
32
+ \alpha
33
+
34
+ </annotation></semantics></math></div><div class="maruku-equation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="maruku-mathml"><semantics><mrow><mi>β</mi></mrow><annotation encoding="application/x-tex"> \beta
35
+
36
+ </annotation></semantics></math></div><div class="maruku-equation"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="maruku-mathml"><semantics><mrow><mi>γ</mi></mrow><annotation encoding="application/x-tex"> \gamma </annotation></semantics></math></div>
29
37
  *** Output of to_latex ***
30
38
  \begin{equation}
31
39
  \alpha
@@ -0,0 +1,17 @@
1
+
2
+ *** Parameters: ***
3
+ require 'maruku/ext/math'; {:html_math_engine => 'itex2mml'}
4
+ *** Markdown input: ***
5
+ This *is* $a * b * c$ ahem.
6
+ *** Output of inspect ***
7
+ md_el(:document, md_par([
8
+ "This ",
9
+ md_em("is"),
10
+ " ",
11
+ md_el(:inline_math, [], {:math=>"a * b * c"}),
12
+ " ahem."
13
+ ]))
14
+ *** Output of to_html ***
15
+ <p>This <em>is</em> <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline" class="maruku-mathml"><semantics><mrow><mi>a</mi><mo>*</mo><mi>b</mi><mo>*</mo><mi>c</mi></mrow><annotation encoding="application/x-tex">a * b * c</annotation></semantics></math> ahem.</p>
16
+ *** Output of to_latex ***
17
+ This \emph{is} $a * b * c$ ahem.
@@ -13,8 +13,8 @@ md_el(:document,[
13
13
  md_html("<table markdown='1'>\n\t$\\alpha$\n\t<thead>\n\t\t<td markdown='1'>$\\beta$</td>\n\t</thead>\n</table>")
14
14
  ],{},[])
15
15
  *** Output of to_html ***
16
- <table><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline" class="maruku-mathml"><mi>α</mi></math><thead>
17
- <td><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline" class="maruku-mathml"><mi>β</mi></math></td>
16
+ <table><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline" class="maruku-mathml"><semantics><mrow><mi>α</mi></mrow><annotation encoding="application/x-tex">\alpha</annotation></semantics></math><thead>
17
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline" class="maruku-mathml"><semantics><mrow><mi>β</mi></mrow><annotation encoding="application/x-tex">\beta</annotation></semantics></math></td>
18
18
  </thead>
19
19
  </table>
20
20
  *** Output of to_latex ***
@@ -13,15 +13,15 @@
13
13
  *** Output of inspect ***
14
14
  md_el(:document,[
15
15
  md_el(:table,[
16
- md_el(:head_cell,["Symbol"],{},[]),
16
+ [md_el(:head_cell,["Symbol"],{},[]),
17
17
  md_el(:head_cell,["Meaning"],{},[]),
18
- md_el(:head_cell,["comments"],{},[]),
19
- md_el(:cell,[" ", md_entity("alpha")],{},[[:ref, "r"]]),
18
+ md_el(:head_cell,["comments"],{},[])],
19
+ [md_el(:cell,[" ", md_entity("alpha")],{},[[:ref, "r"]]),
20
20
  md_el(:cell,["The first"],{},[]),
21
- md_el(:cell,["I like it."],{},[]),
22
- md_el(:cell,[" ", md_entity("aleph")],{},[[:ref, "r"]]),
21
+ md_el(:cell,["I like it."],{},[])],
22
+ [md_el(:cell,[" ", md_entity("aleph")],{},[[:ref, "r"]]),
23
23
  md_el(:cell,["The first"],{},[]),
24
- md_el(:cell,["I like it."],{},[])
24
+ md_el(:cell,["I like it."],{},[])]
25
25
  ],{:align=>[:left, :left, :left]},[]),
26
26
  md_el(:ald,[],{:ald=>[["scope", "row"]],:ald_id=>"r"},[])
27
27
  ],{},[])
@@ -3,8 +3,8 @@ Write a comment here
3
3
  {} # params
4
4
  *** Markdown input: ***
5
5
 
6
- h | h
7
- ----------|--
6
+ h | h
7
+ ----------|---
8
8
  {:t} c1 | c2
9
9
  {: summary="Table summary" .class1 style="color:red" border=3 width="50%" frame=lhs rules=cols cellspacing=2em cellpadding=4px}
10
10
 
@@ -12,10 +12,8 @@ h | h
12
12
  *** Output of inspect ***
13
13
  md_el(:document,[
14
14
  md_el(:table,[
15
- md_el(:head_cell,["h"],{},[]),
16
- md_el(:head_cell,["h"],{},[]),
17
- md_el(:cell,[" c1"],{},[[:ref, "t"]]),
18
- md_el(:cell,["c2"],{},[])
15
+ [md_el(:head_cell,["h"],{},[]),md_el(:head_cell,["h"],{},[])],
16
+ [md_el(:cell,[" c1"],{},[[:ref, "t"]]),md_el(:cell,["c2"],{},[])]
19
17
  ],{:align=>[:left, :left]},[["summary", "Table summary"], [:class, "class1"], ["style", "color:red"], ["border", "3"], ["width", "50%"], ["frame", "lhs"], ["rules", "cols"], ["cellspacing", "2em"], ["cellpadding", "4px"]]),
20
18
  md_el(:ald,[],{:ald=>[["scope", "row"]],:ald_id=>"t"},[])
21
19
  ],{},[])
@@ -0,0 +1,41 @@
1
+ Write a comment here
2
+ *** Parameters: ***
3
+ {} # params
4
+ *** Markdown input: ***
5
+
6
+ | h1 | h2 | h3 |
7
+ |:----------|:---:|-----:|
8
+ |c1 | c2 | c3 |
9
+ |c1 | c2 ||
10
+ |c1 || c2 |
11
+ |c1 |||
12
+ {: summary="Table summary" .class1 style="color:blue" border=1 width="50%" cellspacing=2em cellpadding=4px}
13
+
14
+ {:t: scope="row"}
15
+ *** Output of inspect ***
16
+ md_el(:document,[
17
+ md_el(:table, [
18
+ [md_el(:head_cell, "h1"), md_el(:head_cell, "h2"), md_el(:head_cell, "h3")],
19
+ [md_el(:cell, "c1"), md_el(:cell, "c2"), md_el(:cell, "c3")],
20
+ [md_el(:cell, "c1"), md_el(:cell, "c2", {}, [["colspan", "2"]])],
21
+ [md_el(:cell, "c1", {}, [["colspan", "2"]]), md_el(:cell, "c2")],
22
+ [md_el(:cell, "c1", {}, [["colspan", "3"]])]
23
+ ],{:align=>[:left, :center, :right]},[["summary", "Table summary"], [:class, "class1"], ["style", "color:blue"], ["border", ""], ["width", "50%"], ["frame", "lhs"], ["rules", "cols"], ["cellspacing", "2em"], ["cellpadding", "4px"]]),
24
+ md_el(:ald,[],{:ald=>[["scope", "row"]],:ald_id=>"t"},[])
25
+ ],{},[])
26
+ *** Output of to_html ***
27
+ <table class="class1" style="color:blue" summary="Table summary" width="50%" border="1" cellspacing="2em" cellpadding="4px">
28
+ <thead><tr><th>h1</th><th>h2</th><th>h3</th></tr></thead>
29
+ <tbody><tr><td style="text-align: left;">c1</td><td style="text-align: center;">c2</td><td style="text-align: right;">c3</td></tr>
30
+ <tr><td style="text-align: left;">c1</td><td colspan="2" style="text-align: center;">c2</td></tr>
31
+ <tr><td colspan="2" style="text-align: left;">c1</td><td style="text-align: center;">c2</td></tr>
32
+ <tr><td colspan="3" style="text-align: left;">c1</td></tr></tbody></table>
33
+ *** Output of to_latex ***
34
+ \begin{tabular}{l|c|r}
35
+ h1&h2&h3\\
36
+ \hline
37
+ c1&c2&c3\\
38
+ c1&\multicolumn {2}{|l|}{c2}\\
39
+ \multicolumn {2}{|l|}{c1}&c2\\
40
+ \multicolumn {3}{|l|}{c1}\\
41
+ \end{tabular}
@@ -21,31 +21,19 @@ Content Cell | Content Cell
21
21
  *** Output of inspect ***
22
22
  md_el(:document, [
23
23
  md_el(:table, [
24
- md_el(:head_cell, "Col1"),
25
- md_el(:head_cell, "Very very long head"),
26
- md_el(:head_cell, "Very very long head"),
27
- md_el(:cell, "cell"),
28
- md_el(:cell, "center-align"),
29
- md_el(:cell, "right-align"),
30
- md_el(:cell, "another"),
31
- md_el(:cell, "cell"),
32
- md_el(:cell, "here")
24
+ [md_el(:head_cell, "Col1"), md_el(:head_cell, "Very very long head"), md_el(:head_cell, "Very very long head")],
25
+ [md_el(:cell, "cell"), md_el(:cell, "center-align"), md_el(:cell, "right-align")],
26
+ [md_el(:cell, "another"), md_el(:cell, "cell"), md_el(:cell, "here")]
33
27
  ], {:align=>[:left, :center, :right]}),
34
28
  md_el(:table, [
35
- md_el(:head_cell, "First Header"),
36
- md_el(:head_cell, "Second Header"),
37
- md_el(:cell, "Content Cell"),
38
- md_el(:cell, "Content Cell"),
39
- md_el(:cell, "Content Cell"),
40
- md_el(:cell, "Content Cell")
29
+ [md_el(:head_cell, "First Header"), md_el(:head_cell, "Second Header")],
30
+ [md_el(:cell, "Content Cell"), md_el(:cell, "Content Cell")],
31
+ [md_el(:cell, "Content Cell"), md_el(:cell, "Content Cell")]
41
32
  ], {:align=>[:left, :left]}),
42
33
  md_el(:table, [
43
- md_el(:head_cell, "First Header"),
44
- md_el(:head_cell, "Second Header"),
45
- md_el(:cell, "Content Cell"),
46
- md_el(:cell, "Content Cell"),
47
- md_el(:cell, "Content Cell"),
48
- md_el(:cell, "Content Cell")
34
+ [md_el(:head_cell, "First Header"), md_el(:head_cell, "Second Header")],
35
+ [md_el(:cell, "Content Cell"), md_el(:cell, "Content Cell")],
36
+ [md_el(:cell, "Content Cell"), md_el(:cell, "Content Cell")]
49
37
  ], {:align=>[:left, :left]})
50
38
  ])
51
39
  *** Output of to_html ***
@@ -56,3 +44,4 @@ md_el(:document, [
56
44
  </tbody></table><table><thead><tr><th>First Header</th><th>Second Header</th></tr></thead><tbody><tr><td style="text-align: left;">Content Cell</td><td style="text-align: left;">Content Cell</td></tr>
57
45
  <tr><td style="text-align: left;">Content Cell</td><td style="text-align: left;">Content Cell</td></tr>
58
46
  </tbody></table>
47
+
@@ -0,0 +1,74 @@
1
+ Trailing blanks in table rows
2
+ *** Parameters: ***
3
+ {} # params
4
+ *** Markdown input: ***
5
+
6
+ Col1 | Very very long head | Very very long head|
7
+ ------- |:-------------------:|-------------------:|
8
+ cell | center-align | right-align |
9
+ another | cell | here |
10
+
11
+ | First Header | Second Header |
12
+ | ------------- | ------------- |
13
+ | Content Cell | Content Cell |
14
+ | Content Cell | Content Cell |
15
+
16
+ | First Header | Second Header |
17
+ | ------------- | ------------- |
18
+ | Content Cell | Content Cell |
19
+ | Content Cell | Content Cell |
20
+
21
+ First Header | Second Header|
22
+ ------------- | -------------|
23
+ Content Cell | Content Cell|
24
+ Content Cell | Content Cell|
25
+
26
+ First Header | Second Header
27
+ ------------- | -------------
28
+ Content Cell | Content Cell
29
+ Content Cell |
30
+ Content Cell | Content Cell
31
+
32
+ *** Output of inspect ***
33
+ md_el(:document, [
34
+ md_el(:table, [
35
+ [md_el(:head_cell, "Col1"), md_el(:head_cell, "Very very long head"), md_el(:head_cell, "Very very long head")],
36
+ [md_el(:cell, "cell"), md_el(:cell, "center-align"), md_el(:cell, "right-align")],
37
+ [md_el(:cell, "another"), md_el(:cell, "cell"), md_el(:cell, "here")]
38
+ ], {:align=>[:left, :center, :right]}),
39
+ md_el(:table, [
40
+ [md_el(:head_cell, "First Header"), md_el(:head_cell, "Second Header")],
41
+ [md_el(:cell, "Content Cell"), md_el(:cell, "Content Cell")],
42
+ [md_el(:cell, "Content Cell"), md_el(:cell, "Content Cell")]
43
+ ], {:align=>[:left, :left]}),
44
+ md_el(:table, [
45
+ [md_el(:head_cell, "First Header"), md_el(:head_cell, "Second Header")],
46
+ [md_el(:cell, "Content Cell"), md_el(:cell, "Content Cell")],
47
+ [md_el(:cell, "Content Cell"), md_el(:cell, "Content Cell")]
48
+ ], {:align=>[:left, :left]}),
49
+ md_el(:table, [
50
+ [md_el(:head_cell, "First Header"), md_el(:head_cell, "Second Header")],
51
+ [md_el(:cell, "Content Cell"), md_el(:cell, "Content Cell")],
52
+ [md_el(:cell, "Content Cell"), md_el(:cell, "Content Cell")]
53
+ ], {:align=>[:left, :left]}),
54
+ md_el(:table, [
55
+ [md_el(:head_cell, "First Header"), md_el(:head_cell, "Second Header")],
56
+ [md_el(:cell, "Content Cell"), md_el(:cell, "Content Cell")],
57
+ [md_el(:cell, "Content Cell"), md_el(:cell, [])],
58
+ [md_el(:cell, "Content Cell"), md_el(:cell, "Content Cell")]
59
+ ], {:align=>[:left, :left]})
60
+ ])
61
+ *** Output of to_html ***
62
+ <table><thead><tr><th>Col1</th><th>Very very long head</th><th>Very very long head</th></tr></thead><tbody><tr><td style="text-align: left;">cell</td><td style="text-align: center;">center-align</td><td style="text-align: right;">right-align</td></tr>
63
+ <tr><td style="text-align: left;">another</td><td style="text-align: center;">cell</td><td style="text-align: right;">here</td></tr>
64
+ </tbody></table><table><thead><tr><th>First Header</th><th>Second Header</th></tr></thead><tbody><tr><td style="text-align: left;">Content Cell</td><td style="text-align: left;">Content Cell</td></tr>
65
+ <tr><td style="text-align: left;">Content Cell</td><td style="text-align: left;">Content Cell</td></tr>
66
+ </tbody></table><table><thead><tr><th>First Header</th><th>Second Header</th></tr></thead><tbody><tr><td style="text-align: left;">Content Cell</td><td style="text-align: left;">Content Cell</td></tr>
67
+ <tr><td style="text-align: left;">Content Cell</td><td style="text-align: left;">Content Cell</td></tr>
68
+ </tbody></table><table><thead><tr><th>First Header</th><th>Second Header</th></tr></thead><tbody><tr><td style="text-align: left;">Content Cell</td><td style="text-align: left;">Content Cell</td></tr>
69
+ <tr><td style="text-align: left;">Content Cell</td><td style="text-align: left;">Content Cell</td></tr>
70
+ </tbody></table><table><thead><tr><th>First Header</th><th>Second Header</th></tr></thead><tbody><tr><td style="text-align: left;">Content Cell</td><td style="text-align: left;">Content Cell</td></tr>
71
+ <tr><td style="text-align: left;">Content Cell</td><td style="text-align: left;"></td></tr>
72
+ <tr><td style="text-align: left;">Content Cell</td><td style="text-align: left;">Content Cell</td></tr>
73
+ </tbody></table>
74
+
@@ -0,0 +1,32 @@
1
+ XML Comments need to be handled properly.
2
+ Note that output is kind of weird because we modify the comment in order to let REXML parse it due to https://bugs.ruby-lang.org/issues/9277.
3
+ *** Parameters: ***
4
+ {}
5
+ *** Markdown input: ***
6
+ <!--
7
+ &rsquo;
8
+ -->
9
+
10
+ <!-- declarations for <head> & <body> -->
11
+
12
+ <!-- -- is invalid -->
13
+
14
+ <!-- -- is
15
+ invalid -->
16
+
17
+ *** Output of inspect ***
18
+ md_el(:document,[md_html("<!--\n&rsquo;\n-->"),
19
+ md_html("<!-- declarations for <head> & <body> -->"),
20
+ md_html("<!-- - - is invalid -->"),
21
+ md_html("<!-- - - is\ninvalid -->")])
22
+ *** Output of to_html ***
23
+ <!--
24
+ &rsquo;
25
+ -->
26
+
27
+ <!-- declarations for <head> & <body> -->
28
+
29
+ <!-- - - is invalid -->
30
+
31
+ <!-- - - is
32
+ invalid -->
@@ -23,7 +23,7 @@ EXPECTATIONS = Maruku.new.instance_eval do
23
23
 
24
24
  # Code blocks
25
25
  ["`" , :raise, 'Unclosed single ticks'],
26
- ["``" , :raise, 'Unclosed double ticks'],
26
+ ["``" , [md_entity("ldquo")], 'Empty code block'],
27
27
  ["`a`" , [md_code('a')], 'Simple inline code'],
28
28
  ["`` ` ``" , [md_code('`')], ],
29
29
  ["`` \\` ``" , [md_code('\\`')], ],
@@ -1,2 +1,3 @@
1
+ require 'json'
1
2
  require 'simplecov'
2
3
  SimpleCov.root(File.expand_path(File.dirname(__FILE__) + '/..'))
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maruku
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrea Censi
@@ -32,7 +32,7 @@ cert_chain:
32
32
  KwEyUbH6HjXBdbfv95jHa8ncuWqIryt/ywGZg3sbPVsscZA9RcyDtUQRnlHSGRWH
33
33
  ZSsIzVZvxIwTYa0z3d+JWQ==
34
34
  -----END CERTIFICATE-----
35
- date: 2013-09-28 00:00:00.000000000 Z
35
+ date: 2014-01-15 00:00:00.000000000 Z
36
36
  dependencies: []
37
37
  description: "Maruku is a Markdown interpreter in Ruby.\n\tIt features native export
38
38
  to HTML and PDF (via Latex). The\n\toutput is really beautiful!"
@@ -43,6 +43,18 @@ executables:
43
43
  extensions: []
44
44
  extra_rdoc_files: []
45
45
  files:
46
+ - MIT-LICENSE.txt
47
+ - bin/maruku
48
+ - bin/marutex
49
+ - data/entities.xml
50
+ - docs/div_syntax.md
51
+ - docs/entity_test.md
52
+ - docs/markdown_syntax.md
53
+ - docs/maruku.md
54
+ - docs/math.md
55
+ - docs/other_stuff.md
56
+ - docs/proposal.md
57
+ - lib/maruku.rb
46
58
  - lib/maruku/attributes.rb
47
59
  - lib/maruku/defaults.rb
48
60
  - lib/maruku/document.rb
@@ -50,6 +62,7 @@ files:
50
62
  - lib/maruku/errors.rb
51
63
  - lib/maruku/ext/div.rb
52
64
  - lib/maruku/ext/fenced_code.rb
65
+ - lib/maruku/ext/math.rb
53
66
  - lib/maruku/ext/math/elements.rb
54
67
  - lib/maruku/ext/math/mathml_engines/blahtex.rb
55
68
  - lib/maruku/ext/math/mathml_engines/itex2mml.rb
@@ -58,7 +71,6 @@ files:
58
71
  - lib/maruku/ext/math/parsing.rb
59
72
  - lib/maruku/ext/math/to_html.rb
60
73
  - lib/maruku/ext/math/to_latex.rb
61
- - lib/maruku/ext/math.rb
62
74
  - lib/maruku/helpers.rb
63
75
  - lib/maruku/html.rb
64
76
  - lib/maruku/input/charsource.rb
@@ -84,28 +96,17 @@ files:
84
96
  - lib/maruku/textile2.rb
85
97
  - lib/maruku/toc.rb
86
98
  - lib/maruku/version.rb
87
- - lib/maruku.rb
88
- - docs/div_syntax.md
89
- - docs/entity_test.md
90
- - docs/markdown_syntax.md
91
- - docs/maruku.md
92
- - docs/math.md
93
- - docs/other_stuff.md
94
- - docs/proposal.md
95
- - spec/block_spec.rb
96
- - spec/cli_spec.rb
97
- - spec/span_spec.rb
98
- - spec/spec_helper.rb
99
- - spec/to_html_utf8_spec.rb
100
99
  - spec/block_docs/abbrev.md
101
100
  - spec/block_docs/abbreviations.md
102
101
  - spec/block_docs/alt.md
103
102
  - spec/block_docs/amps.md
103
+ - spec/block_docs/attribute_sanitize.md
104
104
  - spec/block_docs/attributes/att2.md
105
105
  - spec/block_docs/attributes/att3.md
106
106
  - spec/block_docs/attributes/attributes.md
107
107
  - spec/block_docs/attributes/circular.md
108
108
  - spec/block_docs/attributes/default.md
109
+ - spec/block_docs/auto_cdata.md
109
110
  - spec/block_docs/blank.md
110
111
  - spec/block_docs/blanks_in_code.md
111
112
  - spec/block_docs/bug_def.md
@@ -113,7 +114,9 @@ files:
113
114
  - spec/block_docs/code.md
114
115
  - spec/block_docs/code2.md
115
116
  - spec/block_docs/code3.md
117
+ - spec/block_docs/code4.md
116
118
  - spec/block_docs/data_loss.md
119
+ - spec/block_docs/div_without_newline.md
117
120
  - spec/block_docs/divs/div1.md
118
121
  - spec/block_docs/divs/div2.md
119
122
  - spec/block_docs/divs/div3_nest.md
@@ -145,11 +148,18 @@ files:
145
148
  - spec/block_docs/html_trailing.md
146
149
  - spec/block_docs/ie.md
147
150
  - spec/block_docs/iframe.md
151
+ - spec/block_docs/ignore_bad_header.md
148
152
  - spec/block_docs/images.md
149
153
  - spec/block_docs/images2.md
150
154
  - spec/block_docs/inline_html.md
151
155
  - spec/block_docs/inline_html2.md
152
156
  - spec/block_docs/inline_html_beginning.md
157
+ - spec/block_docs/issue106.md
158
+ - spec/block_docs/issue115.md
159
+ - spec/block_docs/issue117.md
160
+ - spec/block_docs/issue120.md
161
+ - spec/block_docs/issue123.md
162
+ - spec/block_docs/issue124.md
153
163
  - spec/block_docs/issue20.md
154
164
  - spec/block_docs/issue26.md
155
165
  - spec/block_docs/issue29.md
@@ -195,6 +205,10 @@ files:
195
205
  - spec/block_docs/lists_paraindent.md
196
206
  - spec/block_docs/lists_tab.md
197
207
  - spec/block_docs/loss.md
208
+ - spec/block_docs/math-blahtex/equations.md
209
+ - spec/block_docs/math-blahtex/inline.md
210
+ - spec/block_docs/math-blahtex/math2.md
211
+ - spec/block_docs/math-blahtex/table.md
198
212
  - spec/block_docs/math/embedded_invalid_svg.md
199
213
  - spec/block_docs/math/embedded_svg.md
200
214
  - spec/block_docs/math/equations.md
@@ -202,12 +216,9 @@ files:
202
216
  - spec/block_docs/math/math2.md
203
217
  - spec/block_docs/math/notmath.md
204
218
  - spec/block_docs/math/raw_mathml.md
219
+ - spec/block_docs/math/spaces_after_inline_math.md
205
220
  - spec/block_docs/math/table.md
206
221
  - spec/block_docs/math/table2.md
207
- - spec/block_docs/math-blahtex/equations.md
208
- - spec/block_docs/math-blahtex/inline.md
209
- - spec/block_docs/math-blahtex/math2.md
210
- - spec/block_docs/math-blahtex/table.md
211
222
  - spec/block_docs/misc_sw.md
212
223
  - spec/block_docs/olist.md
213
224
  - spec/block_docs/one.md
@@ -223,7 +234,9 @@ files:
223
234
  - spec/block_docs/smartypants.md
224
235
  - spec/block_docs/syntax_hl.md
225
236
  - spec/block_docs/table_attributes.md
237
+ - spec/block_docs/table_colspan.md
226
238
  - spec/block_docs/tables.md
239
+ - spec/block_docs/tables2.md
227
240
  - spec/block_docs/test.md
228
241
  - spec/block_docs/ticks.md
229
242
  - spec/block_docs/toc.md
@@ -231,13 +244,14 @@ files:
231
244
  - spec/block_docs/underscore_in_words.md
232
245
  - spec/block_docs/wrapping.md
233
246
  - spec/block_docs/xml.md
234
- - spec/block_docs/xml2.md
235
247
  - spec/block_docs/xml3.md
248
+ - spec/block_docs/xml_comments.md
236
249
  - spec/block_docs/xml_instruction.md
237
- - data/entities.xml
238
- - bin/maruku
239
- - bin/marutex
240
- - MIT-LICENSE.txt
250
+ - spec/block_spec.rb
251
+ - spec/cli_spec.rb
252
+ - spec/span_spec.rb
253
+ - spec/spec_helper.rb
254
+ - spec/to_html_utf8_spec.rb
241
255
  homepage: http://github.com/bhollis/maruku
242
256
  licenses:
243
257
  - MIT
@@ -248,17 +262,17 @@ require_paths:
248
262
  - lib
249
263
  required_ruby_version: !ruby/object:Gem::Requirement
250
264
  requirements:
251
- - - '>='
265
+ - - ">="
252
266
  - !ruby/object:Gem::Version
253
267
  version: 1.8.7
254
268
  required_rubygems_version: !ruby/object:Gem::Requirement
255
269
  requirements:
256
- - - '>='
270
+ - - ">="
257
271
  - !ruby/object:Gem::Version
258
272
  version: '0'
259
273
  requirements: []
260
274
  rubyforge_project:
261
- rubygems_version: 2.0.3
275
+ rubygems_version: 2.2.0.rc.1
262
276
  signing_key:
263
277
  specification_version: 4
264
278
  summary: Maruku is a Markdown-superset interpreter written in Ruby.