REXML is dead. Long live Nokogiri.

Modify Maruku to use Nokogiri instead of REXML.
Produces a 3-fold speedup in the #to_html method.
This commit is contained in:
Jacques Distler 2011-08-11 20:36:44 -05:00
parent 46da1f3aaf
commit 13a522525c
369 changed files with 1703 additions and 16342 deletions

View file

@ -0,0 +1,15 @@
Write a comment here
*** Parameters: ***
{} # params
*** Markdown input: ***
@articles.map(&:title)
*** Output of inspect ***
md_el(:document,[md_el(:code,[],{:raw_code=>"@articles.map(&:title)"},[])],{},[])
*** Output of to_html ***
<pre><code>@articles.map(&amp;:title)</code></pre>
*** Output of to_latex ***
\begin{verbatim}@articles.map(&:title)\end{verbatim}
*** Output of to_md ***
*** Output of to_s ***

View file

@ -0,0 +1,37 @@
Write a comment here
*** Parameters: ***
{} # params
*** Markdown input: ***
| | 1 | 2 |
|----|----|----|
| A | X | |
| B | | X |
*** Output of inspect ***
md_el(:document,[
md_el(:table,[
md_el(:head_cell,[],{},[]),
md_el(:head_cell,["1"],{},[]),
md_el(:head_cell,["2"],{},[]),
md_el(:cell,["A"],{},[]),
md_el(:cell,["X"],{},[]),
md_el(:cell,[],{},[]),
md_el(:cell,["B"],{},[]),
md_el(:cell,[],{},[]),
md_el(:cell,["X"],{},[])
],{:align=>[:left, :left, :left]},[])
],{},[])
*** Output of to_html ***
<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;"/>
</tr><tr><td style="text-align: left;">B</td><td style="text-align: left;"/><td style="text-align: left;">X</td>
</tr></tbody></table>
*** Output of to_latex ***
\begin{tabular}{l|l|l}
&1&2\\
\hline
A&X&\\
B&&X\\
\end{tabular}
*** Output of to_md ***
12AXBX
*** Output of to_s ***
12AXBX

View file

@ -0,0 +1,72 @@
Write a comment here
*** Parameters: ***
{} # params
*** Markdown input: ***
<http://www.aa.com>
<http://www.bb.com>
<http://www.cc.com>
<http://www.dd.com>
<http://www.dd.com>
<a@invalid.it>
<a@invalid.it>
<a@invalid.it>
<a@invalid.it>
*** Output of inspect ***
md_el(:document,[
md_par([md_url("http://www.aa.com")]),
md_par([md_url("http://www.bb.com")]),
md_par([md_url("http://www.cc.com")]),
md_par([md_url("http://www.dd.com")]),
md_el(:code,[],{:raw_code=>"<http://www.dd.com>"},[]),
md_par([md_email("a@invalid.it")]),
md_par([md_email("a@invalid.it")]),
md_par([md_email("a@invalid.it")]),
md_el(:code,[],{:raw_code=>"<a@invalid.it>"},[])
],{},[])
*** Output of to_html ***
<p><a href="http://www.aa.com">http://www.aa.com</a></p>
<p><a href="http://www.bb.com">http://www.bb.com</a></p>
<p><a href="http://www.cc.com">http://www.cc.com</a></p>
<p><a href="http://www.dd.com">http://www.dd.com</a></p>
<pre><code>&lt;http://www.dd.com&gt;</code></pre>
<p><a href="mailto:a@invalid.it">&#097;&#064;&#105;&#110;&#118;&#097;&#108;&#105;&#100;&#046;&#105;&#116;</a></p>
<p><a href="mailto:a@invalid.it">&#097;&#064;&#105;&#110;&#118;&#097;&#108;&#105;&#100;&#046;&#105;&#116;</a></p>
<p><a href="mailto:a@invalid.it">&#097;&#064;&#105;&#110;&#118;&#097;&#108;&#105;&#100;&#046;&#105;&#116;</a></p>
<pre><code>&lt;a@invalid.it&gt;</code></pre>
*** Output of to_latex ***
\href{http://www.aa.com}{http\char58\char47\char47www\char46aa\char46com}
\href{http://www.bb.com}{http\char58\char47\char47www\char46bb\char46com}
\href{http://www.cc.com}{http\char58\char47\char47www\char46cc\char46com}
\href{http://www.dd.com}{http\char58\char47\char47www\char46dd\char46com}
\begin{verbatim}<http://www.dd.com>\end{verbatim}
\href{mailto:a@invalid.it}{a\char64invalid\char46it}
\href{mailto:a@invalid.it}{a\char64invalid\char46it}
\href{mailto:a@invalid.it}{a\char64invalid\char46it}
\begin{verbatim}<a@invalid.it>\end{verbatim}
*** Output of to_md ***
*** Output of to_s ***

View file

@ -0,0 +1,21 @@
Write a comment here
*** Parameters: ***
{} # params
*** Markdown input: ***
[a. b] is a link.
[a. b]: http://site.com/
*** Output of inspect ***
md_el(:document,[
md_par([md_link(["a. b"],"a_b"), " is a link."]),
md_ref_def("a_b", "http://site.com/", {:title=>nil})
],{},[])
*** Output of to_html ***
<p><a href="http://site.com/">a. b</a> is a link.</p>
*** Output of to_latex ***
\href{http://site.com/}{a. b} is a link.
*** Output of to_md ***
a. bis a link.
*** Output of to_s ***
a. b is a link.