Fix another Maruku bbug

Image titles were not being output (a long-standing Maruku bug).
Also fix some broken specs. All the HTML specs pass. I hope they're
"correct".
This commit is contained in:
Jacques Distler 2011-08-14 02:16:15 -05:00
parent 070f689f9c
commit 5c51f930b0
6 changed files with 22 additions and 17 deletions

View file

@ -764,7 +764,8 @@ of the form `#ff00ff`.
url = ref[:url] url = ref[:url]
title = ref[:title] title = ref[:title]
a['src'] = url.to_s a['src'] = url.to_s
a['alt'] = children_to_s a['alt'] = children_to_s
a['title'] = title.to_s if title
else else
maruku_error"Could not find id = #{id.inspect} for\n #{self.inspect}" maruku_error"Could not find id = #{id.inspect} for\n #{self.inspect}"
tell_user "Could not create image with ref_id = #{id.inspect};"+ tell_user "Could not create image with ref_id = #{id.inspect};"+
@ -785,6 +786,7 @@ of the form `#ff00ff`.
a = create_html_element 'img' a = create_html_element 'img'
a['src'] = url.to_s a['src'] = url.to_s
a['alt'] = children_to_s a['alt'] = children_to_s
a['title'] = title.to_s if title
return a return a
end end

View file

@ -54,13 +54,13 @@ md_el(:document,[
*** Output of to_html *** *** Output of to_html ***
<p>This page does not uilizes <img src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Cascading Style Sheets"/></p> <p>This page does not uilizes <img src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Cascading Style Sheets"/></p>
<p>Please mouseover to see the title: <img src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Cascading Style Sheets"/></p> <p>Please mouseover to see the title: <img src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Cascading Style Sheets" title="Title ok!"/></p>
<p>Please mouseover to see the title: <img src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Cascading Style Sheets"/></p> <p>Please mouseover to see the title: <img src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Cascading Style Sheets" title="Title ok!"/></p>
<p>I&#8217;ll say it one more time: this page does not use <img src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Cascading Style Sheets"/></p> <p>I&#8217;ll say it one more time: this page does not use <img src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Cascading Style Sheets" title="Optional title attribute"/></p>
<p>This is double size: <img src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Cascading Style Sheets"/></p> <p>This is double size: <img src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Cascading Style Sheets" title="Optional title attribute"/></p>
*** Output of to_latex *** *** Output of to_latex ***
This page does not uilizes This page does not uilizes

View file

@ -59,7 +59,7 @@ md_el(:document,[
md_html("<img src=\"http://jigsaw.w3.org/css-validator/images/vcss\" />"), md_html("<img src=\"http://jigsaw.w3.org/css-validator/images/vcss\" />"),
md_par(["Without closing:"]), md_par(["Without closing:"]),
md_html("<img src=\"http://jigsaw.w3.org/css-validator/images/vcss\" />"), md_html("<img src=\"http://jigsaw.w3.org/css-validator/images/vcss\" />"),
md_html("<div markdown=\"1\">\n\tThis is *true* markdown text (paragraph)\n\n\t<p markdown=\"1\">\n\t\tThis is *true* markdown text (no paragraph)\n\t</p>\n\t<p markdown=\"block\">\n\t\tThis is *true* markdown text (block paragraph)\n\t</p>\n</div>"), md_html("<div markdown=\"1\">\n This is *true* markdown text (paragraph)\n\n <p markdown=\"1\">\n This is *true* markdown text (no paragraph)\n </p>\n <p markdown=\"block\">\n This is *true* markdown text (block paragraph)\n </p>\n</div>"),
md_html("<table>\n<tr>\n<td markdown=\"1\">This is a *true* markdown text. (no par)</td>\n<td markdown=\"block\">This is *true* markdown text. (par)</td>\n</tr>\n</table>") md_html("<table>\n<tr>\n<td markdown=\"1\">This is a *true* markdown text. (no par)</td>\n<td markdown=\"block\">This is *true* markdown text. (par)</td>\n</tr>\n</table>")
],{},[]) ],{},[])
*** Output of to_html *** *** Output of to_html ***

View file

@ -2,18 +2,17 @@ Write a comment here
*** Parameters: *** *** Parameters: ***
{} # params {} # params
*** Markdown input: *** *** Markdown input: ***
See [foo' bar] See [foo' bar][foo_bar]
[foo' bar]: http://agorf.gr/ [foo_bar]: http://agorf.gr/
*** Output of inspect *** *** Output of inspect ***
md_el(:document,[ md_el(:document,[ md_par([ "See ", md_link(["foo", md_entity("rsquo"), " bar"],"foo_bar")]),
md_par(["See ", md_link(["foo", md_entity("rsquo"), " bar"],"foo_bar")]),
md_ref_def("foo_bar", "http://agorf.gr/", {:title=>nil}) md_ref_def("foo_bar", "http://agorf.gr/", {:title=>nil})
],{},[]) ],{},[])
*** Output of to_html *** *** Output of to_html ***
<p>See <a href='http://agorf.gr/'>foo&#8217; bar</a></p> <p>See <a href="http://agorf.gr/">foo&#8217; bar</a></p>
*** Output of to_latex *** *** Output of to_latex ***
See \href{http://agorf.gr/}{foo'{} bar} See \href{http://agorf.gr/}{foo'{} bar}
*** Output of to_md *** *** Output of to_md ***

View file

@ -22,10 +22,14 @@ md_el(:document,[
md_el(:equation,[],{:label=>nil,:math=>" x = y \n",:num=>nil},[]) md_el(:equation,[],{:label=>nil,:math=>" x = y \n",:num=>nil},[])
],{},[]) ],{},[])
*** Output of to_html *** *** Output of to_html ***
<div class='maruku-equation'><code class='maruku-mathml'> x = y </code><span class='maruku-eq-tex'><code style='display: none'>x = y</code></span></div><div class='maruku-equation'><code class='maruku-mathml'> x = y <div class="maruku-equation"><code class="maruku-mathml"> x = y </code><span class="maruku-eq-tex"><code style="display: none">x = y</code></span></div><div class="maruku-equation"><code class="maruku-mathml"> x
</code><span class='maruku-eq-tex'><code style='display: none'>x = y</code></span></div><div class='maruku-equation'><code class='maruku-mathml'> x = y = y
</code><span class='maruku-eq-tex'><code style='display: none'>x = y</code></span></div><div class='maruku-equation'><code class='maruku-mathml'> x = y </code><span class="maruku-eq-tex"><code style="display: none">x
</code><span class='maruku-eq-tex'><code style='display: none'>x = y</code></span></div> = y</code></span></div><div class="maruku-equation"><code class="maruku-mathml">
x = y
</code><span class="maruku-eq-tex"><code style="display: none">x = y</code></span></div><div class="maruku-equation"><code class="maruku-mathml"> x = y
</code><span class="maruku-eq-tex"><code style="display: none">x = y</code></span></div>
*** Output of to_latex *** *** Output of to_latex ***
\begin{displaymath} \begin{displaymath}
x = y x = y

View file

@ -22,9 +22,9 @@ md_el(:document,[
<p>Here are some formulas:</p> <p>Here are some formulas:</p>
<ul> <ul>
<li><code class='maruku-mathml'>\alpha</code></li> <li><code class="maruku-mathml">\alpha</code></li>
<li><code class='maruku-mathml'>x^{n}+y^{n} \neq z^{n}</code></li> <li><code class="maruku-mathml">x^{n}+y^{n} \neq z^{n}</code></li>
</ul> </ul>
<p>That&#8217;s it, nothing else is supported.</p> <p>That&#8217;s it, nothing else is supported.</p>