I am trying out CommonMark at http://spec.commonmark.org/dingus/
I want the following HTML output, i.e. Foo
and Baz
are emphasized
but Bar
is not emphasized.
<p><em>Foo</em> *Bar* <em>Baz</em></p>
I tried various inputs, but none of them works. I am providing a list of various CommonMark input and HTML output below for attempts that did not work.
Input:
*Foo* *Bar* *Baz*
Output:
<p><em>Foo</em> <em>Bar</em> <em>Baz</em></p>
Result: Of course, this does not work!
Input:
*Foo* <span>*Bar*</span> *Baz*
Output:
<p><em>Foo</em> <span><em>Bar</em></span> <em>Baz</em></p>
Result:
Bar
is still emphasized. This is in agreement with point 7 of the spec regarding HTML blocks where it is clearly mentioned that the<span>
must occur on its own line.Input:
*Foo* <span> *Bar* </span> *Baz*
Output:
<p><em>Foo</em> <span> <em>Bar</em> </span> <em>Baz</em></p>
Result:
Baz
is still emphasized. This time<span>
occurred on its own line. Why did it still not work?
How can I achieve the desired result while conforming to CommonMark?
Foo *Bar* Baz
`. – Lone Learner Aug 16 '17 at 16:47