Another Maruku bug: bold in italics

This commit is contained in:
Jacques Distler 2011-08-27 19:31:02 -05:00
parent a088201062
commit 2801421969
3 changed files with 30 additions and 2 deletions

View file

@ -77,7 +77,10 @@ SpanContext = SpanContext_String # Seems to be faster
end end
break if exit_on_chars && exit_on_chars.include?(c) break if exit_on_chars && exit_on_chars.include?(c)
break if exit_on_strings && exit_on_strings.any? {|x| src.cur_chars_are x} if exit_on_strings && exit_on_strings.any? {|x| src.cur_chars_are x}
# Special case: bold nested in italic
break unless !(['*', '_'] & exit_on_strings).empty? && ['**','__'].include?(src.cur_chars(2))
end
# check if there are extensions # check if there are extensions
if check_span_extensions(src, con) if check_span_extensions(src, con)

View file

@ -0,0 +1,25 @@
More complicated tests for emphasis.
*** Parameters: ***
{}
*** Markdown input: ***
*This is in italic, and **this is bold italics**.* But **is this bold and *this bold-italic* **? Or just plain ***bold italics***.
*** Output of inspect ***
md_el(:document,
[md_par([
md_em([
"This is in italic, and ", md_strong(["this is bold italics"]), "."
]), " But ", md_strong([
"is this bold and ", md_em(["this bold-italic"])
]), "? Or just plain ", md_emstrong(["bold italics"]), "."
])
],{},[])
*** Output of to_html ***
<p><em>This is in italic, and <strong>this is bold italics</strong>.</em> But <strong>is this bold and <em>this bold-italic</em></strong>? Or just plain <strong><em>bold italics</em></strong>.</p>
*** Output of to_latex ***
\emph{This is in italic, and \textbf{this is bold italics}.} But \textbf{is this bold and \emph{this bold-italic}}? Or just plain \textbf{\emph{bold italics}}.
*** Output of to_md ***
*This is in italic, and **this is bold italics**.*
But **is this bold and *this bold-italic* **? Or
just plain ***bold italics***.
*** Output of to_s ***
This is in italic, and this is bold italics. But is this bold and this bold-italic? Or just plain bold italics.

View file

@ -29,7 +29,7 @@ md_el(:document,[
*** Output of to_html *** *** Output of to_html ***
<ul> <ul>
<li> <li>
a <p>a</p>
<ul> <ul>
<li>a1</li> <li>a1</li>