maruku 0.5.7 → 0.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/maruku/ext/math/latex_fix.rb +11 -0
- data/lib/maruku/ext/math/mathml_engines/itex2mml.rb +2 -2
- data/lib/maruku/ext/math/to_latex.rb +4 -3
- data/lib/maruku/input/parse_block.rb +3 -1
- data/lib/maruku/input/parse_span_better.rb +1 -1
- data/lib/maruku/input/type_detection.rb +2 -2
- data/lib/maruku/output/s5/to_s5.rb +13 -1
- data/lib/maruku/output/to_html.rb +22 -4
- data/lib/maruku/string_utils.rb +4 -1
- data/lib/maruku/version.rb +1 -1
- data/tests/unittest/email.md +1 -1
- data/tests/unittest/entities.md +1 -71
- data/tests/unittest/ie.md +1 -30
- data/tests/unittest/links.md +1 -1
- data/tests/unittest/math/table2.md +2 -32
- data/tests/unittest/pending/amps.md +29 -0
- data/tests/unittest/pending/empty_cells.md +53 -0
- data/tests/unittest/pending/link.md +103 -0
- data/tests/unittest/pending/ref.md +34 -0
- metadata +7 -2
@@ -14,8 +14,8 @@ module MaRuKu; module Out; module HTML
|
|
14
14
|
doc = Document.new(mathml, {:respect_whitespace =>:all}).root
|
15
15
|
return doc
|
16
16
|
rescue LoadError => e
|
17
|
-
maruku_error "Could not load package 'itex2mml'.\n"+
|
18
|
-
|
17
|
+
maruku_error "Could not load package 'itex2mml'.\n"+ "Please install it." unless $already_warned_itex2mml
|
18
|
+
$already_warned_itex2mml = true
|
19
19
|
rescue REXML::ParseException => e
|
20
20
|
maruku_error "Invalid MathML TeX: \n#{add_tabs(tex,1,'tex>')}"+
|
21
21
|
"\n\n #{e.inspect}"
|
@@ -1,16 +1,17 @@
|
|
1
|
+
require 'maruku/ext/math/latex_fix'
|
1
2
|
|
2
3
|
module MaRuKu; module Out; module Latex
|
3
4
|
|
4
5
|
def to_latex_inline_math
|
5
|
-
"$#{self.math.strip}$"
|
6
|
+
"$#{self.math.strip}$".fix_latex
|
6
7
|
end
|
7
8
|
|
8
9
|
def to_latex_equation
|
9
10
|
if self.label
|
10
11
|
l = "\\label{#{self.label}}"
|
11
|
-
"\\begin{equation}\n#{self.math.strip}\n#{l}\\end{equation}\n"
|
12
|
+
"\\begin{equation}\n#{self.math.strip}\n#{l}\\end{equation}\n".fix_latex
|
12
13
|
else
|
13
|
-
"\\begin{displaymath}\n#{self.math.strip}\n\\end{displaymath}\n"
|
14
|
+
"\\begin{displaymath}\n#{self.math.strip}\n\\end{displaymath}\n".fix_latex
|
14
15
|
end
|
15
16
|
end
|
16
17
|
|
@@ -508,7 +508,9 @@ module MaRuKu; module In; module Markdown; module BlockLevelParser
|
|
508
508
|
end
|
509
509
|
|
510
510
|
def split_cells(s)
|
511
|
-
s.strip.split('|').select{|x|x.strip.size>0}.map{|x|x.strip}
|
511
|
+
# s.strip.split('|').select{|x|x.strip.size>0}.map{|x|x.strip}
|
512
|
+
# changed to allow empty cells
|
513
|
+
s.strip.split('|').select{|x|x.size>0}.map{|x|x.strip}
|
512
514
|
end
|
513
515
|
|
514
516
|
def read_table(src)
|
@@ -594,7 +594,7 @@ module MaRuKu; module In; module Markdown; module SpanLevelParser
|
|
594
594
|
return
|
595
595
|
end
|
596
596
|
else # empty [link]
|
597
|
-
id = children.to_s
|
597
|
+
id = sanitize_ref_id(children.to_s) #. downcase.gsub(' ','_')
|
598
598
|
con.push_element md_link(children, id)
|
599
599
|
end
|
600
600
|
end # read link
|
@@ -44,8 +44,8 @@ module MaRuKu; module Strings
|
|
44
44
|
return :definition if l =~ Definition
|
45
45
|
# I had a bug with emails and urls at the beginning of the
|
46
46
|
# line that were mistaken for raw_html
|
47
|
-
return :text if l=~
|
48
|
-
return :text if l=~
|
47
|
+
return :text if l=~ /^[ ]{0,3}#{EMailAddress}/
|
48
|
+
return :text if l=~ /^[ ]{0,3}<http:/
|
49
49
|
# raw html is like PHP Markdown Extra: at most three spaces before
|
50
50
|
return :xml_instr if l =~ %r{^\s*<\?}
|
51
51
|
return :raw_html if l =~ %r{^[ ]?[ ]?[ ]?</?\s*\w+}
|
@@ -2,6 +2,18 @@
|
|
2
2
|
module MaRuKu
|
3
3
|
|
4
4
|
class MDDocument
|
5
|
+
|
6
|
+
def s5_theme
|
7
|
+
html_escape(self.attributes[:slide_theme] || "default")
|
8
|
+
end
|
9
|
+
|
10
|
+
def html_escape(string)
|
11
|
+
string.gsub( /&/, "&" ).
|
12
|
+
gsub( /</, "<" ).
|
13
|
+
gsub( />/, ">" ).
|
14
|
+
gsub( /'/, "'" ).
|
15
|
+
gsub( /"/, """ )
|
16
|
+
end
|
5
17
|
|
6
18
|
# Render as an HTML fragment (no head, just the content of BODY). (returns a string)
|
7
19
|
def to_s5(context={})
|
@@ -42,7 +54,7 @@ module MaRuKu
|
|
42
54
|
dummy_layout_slide =
|
43
55
|
"
|
44
56
|
<div class='layout'>
|
45
|
-
<div id='controls'
|
57
|
+
<div id='controls'> </div>
|
46
58
|
<div id='currentSlide'> </div>
|
47
59
|
<div id='header'> #{slide_header}</div>
|
48
60
|
<div id='footer'>
|
@@ -157,6 +157,23 @@ Synonim for `title`.
|
|
157
157
|
=end
|
158
158
|
|
159
159
|
|
160
|
+
# Render to an HTML fragment (returns a REXML document tree)
|
161
|
+
def to_html_tree
|
162
|
+
div = Element.new 'div'
|
163
|
+
div.attributes['class'] = 'maruku_wrapper_div'
|
164
|
+
children_to_html.each do |e|
|
165
|
+
div << e
|
166
|
+
end
|
167
|
+
|
168
|
+
# render footnotes
|
169
|
+
if @doc.footnotes_order.size > 0
|
170
|
+
div << render_footnotes
|
171
|
+
end
|
172
|
+
|
173
|
+
doc = Document.new(nil,{:respect_whitespace =>:all})
|
174
|
+
doc << div
|
175
|
+
end
|
176
|
+
|
160
177
|
=begin maruku_doc
|
161
178
|
Attribute: css
|
162
179
|
Scope: document
|
@@ -166,11 +183,12 @@ Summary: Activates CSS stylesheets for HTML.
|
|
166
183
|
`css` should be a space-separated list of urls.
|
167
184
|
|
168
185
|
Example:
|
169
|
-
|
186
|
+
|
170
187
|
CSS: style.css math.css
|
171
188
|
|
172
189
|
=end
|
173
190
|
|
191
|
+
|
174
192
|
# Render to a complete HTML document (returns a REXML document tree)
|
175
193
|
def to_html_document_tree
|
176
194
|
doc = Document.new(nil,{:respect_whitespace =>:all})
|
@@ -465,7 +483,7 @@ by Maruku, to have the same results in both HTML and LaTeX.
|
|
465
483
|
end
|
466
484
|
|
467
485
|
def source2html(source)
|
468
|
-
source = source.gsub(/&/,'&')
|
486
|
+
# source = source.gsub(/&/,'&')
|
469
487
|
source = Text.normalize(source)
|
470
488
|
source = source.gsub(/\'/,''') # IE bug
|
471
489
|
source = source.gsub(/'/,''') # IE bug
|
@@ -591,7 +609,7 @@ of the form `#ff00ff`.
|
|
591
609
|
code = Element.new 'code', pre
|
592
610
|
s = source
|
593
611
|
|
594
|
-
s = s.gsub(/&/,'&')
|
612
|
+
# s = s.gsub(/&/,'&')
|
595
613
|
s = Text.normalize(s)
|
596
614
|
s = s.gsub(/\'/,''') # IE bug
|
597
615
|
s = s.gsub(/'/,''') # IE bug
|
@@ -892,7 +910,7 @@ If true, raw HTML is discarded from the output.
|
|
892
910
|
# Entity.new(entity_name)
|
893
911
|
Text.new('&#%d;' % [entity_name], false, nil, true)
|
894
912
|
else
|
895
|
-
Text.new('&%s;' % [entity_name])
|
913
|
+
Text.new('&%s;' % [entity_name], false, nil, true)
|
896
914
|
end
|
897
915
|
end
|
898
916
|
|
data/lib/maruku/string_utils.rb
CHANGED
@@ -53,7 +53,9 @@ module MaRuKu; module Strings
|
|
53
53
|
keys[:data] = $'
|
54
54
|
headers = $1
|
55
55
|
headers.split("\n").each do |l|
|
56
|
-
|
56
|
+
# Fails if there are other ':' characters.
|
57
|
+
# k, v = l.split(':')
|
58
|
+
k, v = l.split(':', 2)
|
57
59
|
k, v = normalize_key_and_value(k, v)
|
58
60
|
k = k.to_sym
|
59
61
|
# puts "K = #{k}, V=#{v}"
|
@@ -146,6 +148,7 @@ module MaRuKu; module Strings
|
|
146
148
|
s[0, i+1].strip
|
147
149
|
end
|
148
150
|
|
151
|
+
# change space to "_" and remove any non-word character
|
149
152
|
def sanitize_ref_id(x)
|
150
153
|
x.downcase.gsub(' ','_').gsub(/[^\w]/,'')
|
151
154
|
end
|
data/lib/maruku/version.rb
CHANGED
data/tests/unittest/email.md
CHANGED
@@ -27,7 +27,7 @@ This is an email address:
|
|
27
27
|
|
28
28
|
|
29
29
|
*** Output of Markdown.pl ***
|
30
|
-
<p>This is an email address: <a href="&#
|
30
|
+
<p>This is an email address: <a href="mailto:andrea@invalid.it">andrea@invalid.it</a></p>
|
31
31
|
|
32
32
|
*** Output of Markdown.pl (parsed) ***
|
33
33
|
Error: #<NoMethodError: private method `write_children' called for <div> ... </>:REXML::Element>
|
data/tests/unittest/entities.md
CHANGED
@@ -96,80 +96,10 @@ Maruku translates HTML entities to the equivalent in LaTeX:EntityResultabEntity-
|
|
96
96
|
|
97
97
|
|
98
98
|
|
99
|
+
OK!
|
99
100
|
|
100
|
-
Failed tests: [:to_html]
|
101
101
|
|
102
|
-
*** Output of inspect ***
|
103
|
-
md_el(:document,[
|
104
|
-
md_par(["Maruku translates HTML entities to the equivalent in LaTeX:"]),
|
105
|
-
md_el(:table,[
|
106
|
-
md_el(:head_cell,["Entity"],{},[]),
|
107
|
-
md_el(:head_cell,["Result"],{},[]),
|
108
|
-
md_el(:cell,[md_code("©")],{},[]),
|
109
|
-
md_el(:cell,[md_entity("copy")],{},[]),
|
110
|
-
md_el(:cell,[md_code("£")],{},[]),
|
111
|
-
md_el(:cell,[md_entity("pound")],{},[]),
|
112
|
-
md_el(:cell,[md_code("a b")],{},[]),
|
113
|
-
md_el(:cell,["a", md_entity("nbsp"), "b"],{},[]),
|
114
|
-
md_el(:cell,[md_code("λ")],{},[]),
|
115
|
-
md_el(:cell,[md_entity("lambda")],{},[]),
|
116
|
-
md_el(:cell,[md_code("—")],{},[]),
|
117
|
-
md_el(:cell,[md_entity("mdash")],{},[])
|
118
|
-
],{:align=>[:left, :left]},[]),
|
119
|
-
md_par([
|
120
|
-
"Entity-substitution does not happen in code blocks or inline code."
|
121
|
-
]),
|
122
|
-
md_par(["The following should not be translated:"]),
|
123
|
-
md_el(:code,[],{:raw_code=>"©"},[]),
|
124
|
-
md_par(["It should read just like this: ", md_code("©"), "."])
|
125
|
-
],{},[])
|
126
|
-
*** Output of to_html ***
|
127
|
-
-----| WARNING | -----
|
128
|
-
<p>Maruku translates HTML entities to the equivalent in LaTeX:</p>
|
129
|
-
<table><thead><tr><th>Entity</th><th>Result</th></tr></thead><tbody><tr><td style='text-align: left;'><code>&amp;copy;</code></td><td style='text-align: left;'>©</td>
|
130
|
-
</tr><tr><td style='text-align: left;'><code>&amp;pound;</code></td><td style='text-align: left;'>£</td>
|
131
|
-
</tr><tr><td style='text-align: left;'><code>a&amp;nbsp;b</code></td><td style='text-align: left;'>a b</td>
|
132
|
-
</tr><tr><td style='text-align: left;'><code>&amp;lambda;</code></td><td style='text-align: left;'>λ</td>
|
133
|
-
</tr><tr><td style='text-align: left;'><code>&amp;mdash;</code></td><td style='text-align: left;'>—</td>
|
134
|
-
</tr></tbody></table>
|
135
|
-
<p>Entity-substitution does not happen in code blocks or inline code.</p>
|
136
|
-
|
137
|
-
<p>The following should not be translated:</p>
|
138
|
-
|
139
|
-
<pre><code>&amp;copy;</code></pre>
|
140
102
|
|
141
|
-
<p>It should read just like this: <code>&amp;copy;</code>.</p>
|
142
|
-
*** Output of to_latex ***
|
143
|
-
Maruku translates HTML entities to the equivalent in \LaTeX\xspace :
|
144
|
-
|
145
|
-
\begin{tabular}{l|l}
|
146
|
-
Entity&Result\\
|
147
|
-
\hline
|
148
|
-
{\colorbox[rgb]{1.00,0.93,1.00}{\tt \char38copy\char59}}&\copyright{}\\
|
149
|
-
{\colorbox[rgb]{1.00,0.93,1.00}{\tt \char38pound\char59}}&\pounds{}\\
|
150
|
-
{\colorbox[rgb]{1.00,0.93,1.00}{\tt a\char38nbsp\char59b}}&a~{}b\\
|
151
|
-
{\colorbox[rgb]{1.00,0.93,1.00}{\tt \char38lambda\char59}}&$\lambda${}\\
|
152
|
-
{\colorbox[rgb]{1.00,0.93,1.00}{\tt \char38mdash\char59}}&---{}\\
|
153
|
-
\end{tabular}
|
154
|
-
|
155
|
-
Entity-substitution does not happen in code blocks or inline code.
|
156
|
-
|
157
|
-
The following should not be translated:
|
158
|
-
|
159
|
-
\begin{verbatim}©\end{verbatim}
|
160
|
-
It should read just like this: {\colorbox[rgb]{1.00,0.93,1.00}{\tt \char38copy\char59}}.
|
161
|
-
*** Output of to_md ***
|
162
|
-
Maruku translates HTML entities to the
|
163
|
-
equivalent in LaTeX:
|
164
|
-
|
165
|
-
EntityResultabEntity-substitution does not happen in
|
166
|
-
code blocks or inline code.
|
167
|
-
|
168
|
-
The following should not be translated:
|
169
|
-
|
170
|
-
It should read just like this: .
|
171
|
-
*** Output of to_s ***
|
172
|
-
Maruku translates HTML entities to the equivalent in LaTeX:EntityResultabEntity-substitution does not happen in code blocks or inline code.The following should not be translated:It should read just like this: .
|
173
103
|
*** Output of Markdown.pl ***
|
174
104
|
<p>Maruku translates HTML entities to the equivalent in LaTeX:</p>
|
175
105
|
|
data/tests/unittest/ie.md
CHANGED
@@ -51,38 +51,9 @@ md_el(:document,[
|
|
51
51
|
|
52
52
|
|
53
53
|
|
54
|
+
OK!
|
54
55
|
|
55
|
-
Failed tests: [:to_html]
|
56
56
|
|
57
|
-
*** Output of inspect ***
|
58
|
-
md_el(:document,[
|
59
|
-
md_par([md_code("<p>here's an apostrophe & a quote \"</p>")]),
|
60
|
-
md_el(:code,[],{:raw_code=>"<p>here's an apostrophe & a quote \"</p>"},[]),
|
61
|
-
md_el(:code,[],{:raw_code=>"<p>here's an apostrophe & a quote \"</p>"},[["lang", "xml"]]),
|
62
|
-
md_el(:code,[],{:raw_code=>"<p>here's an apostrophe & a quote \"</p>"},[["html_use_syntax", "true"], ["lang", "not_supported"]]),
|
63
|
-
md_el(:code,[],{:raw_code=>"<p>here's an apostrophe & a quote \"</p>"},[["html_use_syntax", "true"], ["lang", "xml"]])
|
64
|
-
],{},[])
|
65
|
-
*** Output of to_html ***
|
66
|
-
-----| WARNING | -----
|
67
|
-
<p><code><p>here's an apostrophe &amp; a quote "</p></code></p>
|
68
|
-
|
69
|
-
<pre><code><p>here's an apostrophe &amp; a quote "</p></code></pre>
|
70
|
-
|
71
|
-
<pre lang='xml'><code class='xml' lang='xml'><p>here's an apostrophe &amp; a quote "</p></code></pre>
|
72
|
-
|
73
|
-
<pre><code class='not_supported' lang='not_supported'><p>here's an apostrophe & a quote "</p></code></pre>
|
74
|
-
|
75
|
-
<pre><code class='xml' lang='xml'><span class='punct'><</span><span class='tag'>p</span><span class='punct'>></span>here's an apostrophe & a quote "<span class='punct'></</span><span class='tag'>p</span><span class='punct'>></span></code></pre>
|
76
|
-
*** Output of to_latex ***
|
77
|
-
{\colorbox[rgb]{1.00,0.93,1.00}{\tt \char60p\char62here\char39s~an~apostrophe~\char38~a~quote~\char34\char60\char47p\char62}}
|
78
|
-
|
79
|
-
\begin{verbatim}<p>here's an apostrophe & a quote "</p>\end{verbatim}
|
80
|
-
\begin{verbatim}<p>here's an apostrophe & a quote "</p>\end{verbatim}
|
81
|
-
\begin{verbatim}<p>here's an apostrophe & a quote "</p>\end{verbatim}
|
82
|
-
\begin{verbatim}<p>here's an apostrophe & a quote "</p>\end{verbatim}
|
83
|
-
*** Output of to_md ***
|
84
|
-
|
85
|
-
*** Output of to_s ***
|
86
57
|
|
87
58
|
*** Output of Markdown.pl ***
|
88
59
|
<p><code><p>here's an apostrophe & a quote "</p></code></p>
|
data/tests/unittest/links.md
CHANGED
@@ -162,7 +162,7 @@ Search on GoogleSearch on GoogleSearch on GoogleSearch on GoogleSearch on Google
|
|
162
162
|
|
163
163
|
<p>Inline with title: <a href="http://google.com "Title"">Google images</a></p>
|
164
164
|
|
165
|
-
<p>Search on <a href="http://www.gogole.com">http://www.gogole.com</a> or <a href="http://Here.com">http://Here.com</a> or ask <a href="m&#
|
165
|
+
<p>Search on <a href="http://www.gogole.com">http://www.gogole.com</a> or <a href="http://Here.com">http://Here.com</a> or ask <a href="mailto:bill@google.com">bill@google.com</a>
|
166
166
|
or you might ask bill@google.com.</p>
|
167
167
|
|
168
168
|
<p>If all else fails, ask <a href="http://www.google.com">Google</a></p>
|
@@ -44,40 +44,10 @@ SymbolMeaningcomments The firstI like it. The firstI like it.
|
|
44
44
|
|
45
45
|
|
46
46
|
|
47
|
+
OK!
|
48
|
+
|
47
49
|
|
48
|
-
Failed tests: [:to_html]
|
49
50
|
|
50
|
-
*** Output of inspect ***
|
51
|
-
md_el(:document,[
|
52
|
-
md_el(:table,[
|
53
|
-
md_el(:head_cell,["Symbol"],{},[]),
|
54
|
-
md_el(:head_cell,["Meaning"],{},[]),
|
55
|
-
md_el(:head_cell,["comments"],{},[]),
|
56
|
-
md_el(:cell,[" ", md_entity("alpha")],{},[[:ref, "r"]]),
|
57
|
-
md_el(:cell,["The first"],{},[]),
|
58
|
-
md_el(:cell,["I like it."],{},[]),
|
59
|
-
md_el(:cell,[" ", md_entity("aleph")],{},[[:ref, "r"]]),
|
60
|
-
md_el(:cell,["The first"],{},[]),
|
61
|
-
md_el(:cell,["I like it."],{},[])
|
62
|
-
],{:align=>[:left, :left, :left]},[]),
|
63
|
-
md_el(:ald,[],{:ald=>[["scope", "row"]],:ald_id=>"r"},[])
|
64
|
-
],{},[])
|
65
|
-
*** Output of to_html ***
|
66
|
-
-----| WARNING | -----
|
67
|
-
<table><thead><tr><th>Symbol</th><th>Meaning</th><th>comments</th></tr></thead><tbody><tr><th scope='row' style='text-align: left;'> α</th><td style='text-align: left;'>The first</td><td style='text-align: left;'>I like it.</td>
|
68
|
-
</tr><tr><th scope='row' style='text-align: left;'> &aleph;</th><td style='text-align: left;'>The first</td><td style='text-align: left;'>I like it.</td>
|
69
|
-
</tr></tbody></table>
|
70
|
-
*** Output of to_latex ***
|
71
|
-
\begin{tabular}{l|l|l}
|
72
|
-
Symbol&Meaning&comments\\
|
73
|
-
\hline
|
74
|
-
$\alpha${}&The first&I like it.\\
|
75
|
-
&The first&I like it.\\
|
76
|
-
\end{tabular}
|
77
|
-
*** Output of to_md ***
|
78
|
-
SymbolMeaningcomments The firstI like it. The firstI like it.
|
79
|
-
*** Output of to_s ***
|
80
|
-
SymbolMeaningcomments The firstI like it. The firstI like it.
|
81
51
|
*** Output of Markdown.pl ***
|
82
52
|
<p>Symbol | Meaning | comments
|
83
53
|
------------|---------|---------
|
@@ -0,0 +1,29 @@
|
|
1
|
+
Write a comment here
|
2
|
+
*** Parameters: ***
|
3
|
+
{} # params
|
4
|
+
*** Markdown input: ***
|
5
|
+
@articles.map(&:title)
|
6
|
+
*** Output of inspect ***
|
7
|
+
md_el(:document,[md_el(:code,[],{:raw_code=>"@articles.map(&:title)"},[])],{},[])
|
8
|
+
*** Output of to_html ***
|
9
|
+
<pre><code>@articles.map(&:title)</code></pre>
|
10
|
+
*** Output of to_latex ***
|
11
|
+
\begin{verbatim}@articles.map(&:title)\end{verbatim}
|
12
|
+
*** Output of to_md ***
|
13
|
+
|
14
|
+
*** Output of to_s ***
|
15
|
+
|
16
|
+
*** EOF ***
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
OK!
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
*** Output of Markdown.pl ***
|
25
|
+
<pre><code>@articles.map(&:title)
|
26
|
+
</code></pre>
|
27
|
+
|
28
|
+
*** Output of Markdown.pl (parsed) ***
|
29
|
+
Error: #<NoMethodError: private method `write_children' called for <div> ... </>:REXML::Element>
|
@@ -0,0 +1,53 @@
|
|
1
|
+
Write a comment here
|
2
|
+
*** Parameters: ***
|
3
|
+
{} # params
|
4
|
+
*** Markdown input: ***
|
5
|
+
| | 1 | 2 |
|
6
|
+
|----|----|----|
|
7
|
+
| A | X | |
|
8
|
+
| B | | X |
|
9
|
+
*** Output of inspect ***
|
10
|
+
md_el(:document,[
|
11
|
+
md_el(:table,[
|
12
|
+
md_el(:head_cell,[],{},[]),
|
13
|
+
md_el(:head_cell,["1"],{},[]),
|
14
|
+
md_el(:head_cell,["2"],{},[]),
|
15
|
+
md_el(:cell,["A"],{},[]),
|
16
|
+
md_el(:cell,["X"],{},[]),
|
17
|
+
md_el(:cell,[],{},[]),
|
18
|
+
md_el(:cell,["B"],{},[]),
|
19
|
+
md_el(:cell,[],{},[]),
|
20
|
+
md_el(:cell,["X"],{},[])
|
21
|
+
],{:align=>[:left, :left, :left]},[])
|
22
|
+
],{},[])
|
23
|
+
*** Output of to_html ***
|
24
|
+
<table><thead><tr><th /><th>1</th><th>2</th></tr></thead><tbody><tr><td style='text-align: left;'>A</td><td style='text-align: left;'>X</td><td style='text-align: left;' />
|
25
|
+
</tr><tr><td style='text-align: left;'>B</td><td style='text-align: left;' /><td style='text-align: left;'>X</td>
|
26
|
+
</tr></tbody></table>
|
27
|
+
*** Output of to_latex ***
|
28
|
+
\begin{tabular}{l|l|l}
|
29
|
+
&1&2\\
|
30
|
+
\hline
|
31
|
+
A&X&\\
|
32
|
+
B&&X\\
|
33
|
+
\end{tabular}
|
34
|
+
*** Output of to_md ***
|
35
|
+
12AXBX
|
36
|
+
*** Output of to_s ***
|
37
|
+
12AXBX
|
38
|
+
*** EOF ***
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
OK!
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
*** Output of Markdown.pl ***
|
47
|
+
<p>| | 1 | 2 |
|
48
|
+
|----|----|----|
|
49
|
+
| A | X | |
|
50
|
+
| B | | X |</p>
|
51
|
+
|
52
|
+
*** Output of Markdown.pl (parsed) ***
|
53
|
+
Error: #<NoMethodError: private method `write_children' called for <div> ... </>:REXML::Element>
|
@@ -0,0 +1,103 @@
|
|
1
|
+
Write a comment here
|
2
|
+
*** Parameters: ***
|
3
|
+
{} # params
|
4
|
+
*** Markdown input: ***
|
5
|
+
<http://www.aa.com>
|
6
|
+
|
7
|
+
<http://www.bb.com>
|
8
|
+
|
9
|
+
<http://www.cc.com>
|
10
|
+
|
11
|
+
<http://www.dd.com>
|
12
|
+
|
13
|
+
<http://www.dd.com>
|
14
|
+
|
15
|
+
<a@invalid.it>
|
16
|
+
|
17
|
+
<a@invalid.it>
|
18
|
+
|
19
|
+
<a@invalid.it>
|
20
|
+
|
21
|
+
<a@invalid.it>
|
22
|
+
*** Output of inspect ***
|
23
|
+
md_el(:document,[
|
24
|
+
md_par([md_url("http://www.aa.com")]),
|
25
|
+
md_par([md_url("http://www.bb.com")]),
|
26
|
+
md_par([md_url("http://www.cc.com")]),
|
27
|
+
md_par([md_url("http://www.dd.com")]),
|
28
|
+
md_el(:code,[],{:raw_code=>"<http://www.dd.com>"},[]),
|
29
|
+
md_par([md_email("a@invalid.it")]),
|
30
|
+
md_par([md_email("a@invalid.it")]),
|
31
|
+
md_par([md_email("a@invalid.it")]),
|
32
|
+
md_el(:code,[],{:raw_code=>"<a@invalid.it>"},[])
|
33
|
+
],{},[])
|
34
|
+
*** Output of to_html ***
|
35
|
+
<p><a href='http://www.aa.com'>http://www.aa.com</a></p>
|
36
|
+
|
37
|
+
<p><a href='http://www.bb.com'>http://www.bb.com</a></p>
|
38
|
+
|
39
|
+
<p><a href='http://www.cc.com'>http://www.cc.com</a></p>
|
40
|
+
|
41
|
+
<p><a href='http://www.dd.com'>http://www.dd.com</a></p>
|
42
|
+
|
43
|
+
<pre><code><http://www.dd.com></code></pre>
|
44
|
+
|
45
|
+
<p><a href='mailto:a@invalid.it'>a@invalid.it</a></p>
|
46
|
+
|
47
|
+
<p><a href='mailto:a@invalid.it'>a@invalid.it</a></p>
|
48
|
+
|
49
|
+
<p><a href='mailto:a@invalid.it'>a@invalid.it</a></p>
|
50
|
+
|
51
|
+
<pre><code><a@invalid.it></code></pre>
|
52
|
+
*** Output of to_latex ***
|
53
|
+
\href{http://www.aa.com}{http\char58\char47\char47www\char46aa\char46com}
|
54
|
+
|
55
|
+
\href{http://www.bb.com}{http\char58\char47\char47www\char46bb\char46com}
|
56
|
+
|
57
|
+
\href{http://www.cc.com}{http\char58\char47\char47www\char46cc\char46com}
|
58
|
+
|
59
|
+
\href{http://www.dd.com}{http\char58\char47\char47www\char46dd\char46com}
|
60
|
+
|
61
|
+
\begin{verbatim}<http://www.dd.com>\end{verbatim}
|
62
|
+
\href{mailto:a@invalid.it}{a\char64invalid\char46it}
|
63
|
+
|
64
|
+
\href{mailto:a@invalid.it}{a\char64invalid\char46it}
|
65
|
+
|
66
|
+
\href{mailto:a@invalid.it}{a\char64invalid\char46it}
|
67
|
+
|
68
|
+
\begin{verbatim}<a@invalid.it>\end{verbatim}
|
69
|
+
*** Output of to_md ***
|
70
|
+
|
71
|
+
*** Output of to_s ***
|
72
|
+
|
73
|
+
*** EOF ***
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
OK!
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
*** Output of Markdown.pl ***
|
82
|
+
<p><a href="http://www.aa.com">http://www.aa.com</a></p>
|
83
|
+
|
84
|
+
<p><a href="http://www.bb.com">http://www.bb.com</a></p>
|
85
|
+
|
86
|
+
<p><a href="http://www.cc.com">http://www.cc.com</a></p>
|
87
|
+
|
88
|
+
<p><a href="http://www.dd.com">http://www.dd.com</a></p>
|
89
|
+
|
90
|
+
<pre><code><http://www.dd.com>
|
91
|
+
</code></pre>
|
92
|
+
|
93
|
+
<p><a href="mailto:a@invalid.it">a@invalid.it</a></p>
|
94
|
+
|
95
|
+
<p><a href="mailto:a@invalid.it">a@invalid.it</a></p>
|
96
|
+
|
97
|
+
<p><a href="mailto:a@invalid.it">a@invalid.it</a></p>
|
98
|
+
|
99
|
+
<pre><code><a@invalid.it>
|
100
|
+
</code></pre>
|
101
|
+
|
102
|
+
*** Output of Markdown.pl (parsed) ***
|
103
|
+
Error: #<NoMethodError: private method `write_children' called for <div> ... </>:REXML::Element>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
Write a comment here
|
2
|
+
*** Parameters: ***
|
3
|
+
{} # params
|
4
|
+
*** Markdown input: ***
|
5
|
+
[a. b] is a link.
|
6
|
+
|
7
|
+
[a. b]: http://site.com/
|
8
|
+
|
9
|
+
*** Output of inspect ***
|
10
|
+
md_el(:document,[
|
11
|
+
md_par([md_link(["a. b"],"a_b"), " is a link."]),
|
12
|
+
md_ref_def("a_b", "http://site.com/", {:title=>nil})
|
13
|
+
],{},[])
|
14
|
+
*** Output of to_html ***
|
15
|
+
<p><a href='http://site.com/'>a. b</a> is a link.</p>
|
16
|
+
*** Output of to_latex ***
|
17
|
+
\href{http://site.com/}{a. b} is a link.
|
18
|
+
*** Output of to_md ***
|
19
|
+
a. bis a link.
|
20
|
+
*** Output of to_s ***
|
21
|
+
a. b is a link.
|
22
|
+
*** EOF ***
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
OK!
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
*** Output of Markdown.pl ***
|
31
|
+
<p>[a. b] is a link.</p>
|
32
|
+
|
33
|
+
*** Output of Markdown.pl (parsed) ***
|
34
|
+
Error: #<NoMethodError: private method `write_children' called for <div> ... </>:REXML::Element>
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.10
|
|
3
3
|
specification_version: 1
|
4
4
|
name: maruku
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.5.
|
7
|
-
date:
|
6
|
+
version: 0.5.8
|
7
|
+
date: 2008-02-17
|
8
8
|
summary: Maruku is a Markdown-superset interpreter written in Ruby.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -43,6 +43,7 @@ files:
|
|
43
43
|
- lib/maruku/version.rb
|
44
44
|
- lib/maruku/ext/math.rb
|
45
45
|
- lib/maruku/ext/math/elements.rb
|
46
|
+
- lib/maruku/ext/math/latex_fix.rb
|
46
47
|
- lib/maruku/ext/math/parsing.rb
|
47
48
|
- lib/maruku/ext/math/to_html.rb
|
48
49
|
- lib/maruku/ext/math/to_latex.rb
|
@@ -205,6 +206,10 @@ files:
|
|
205
206
|
- tests/unittest/notyet/triggering.md
|
206
207
|
- tests/unittest/paragraph_rules/dont_merge_ref.md
|
207
208
|
- tests/unittest/paragraph_rules/tab_is_blank.md
|
209
|
+
- tests/unittest/pending/amps.md
|
210
|
+
- tests/unittest/pending/empty_cells.md
|
211
|
+
- tests/unittest/pending/link.md
|
212
|
+
- tests/unittest/pending/ref.md
|
208
213
|
- tests/unittest/recover/recover_links.md
|
209
214
|
- tests/unittest/references/long_example.md
|
210
215
|
- tests/unittest/references/spaces_and_numbers.md
|