Artifact 9a2440fd9b07fb8a8182c323cd38d8a2f0eb4068785aeb09da4f978fb741b87b:
- File test/markdown-test2.md — part of check-in [37806e85d2] at 2020-06-11 21:03:53 on branch trunk — In the Markdown formatter, bring emphasis markup into closer alignment with the CommonMark spec. In particular, this should allow underscores in the middle of identifiers to be rendered correctly without escapes. (user: drh size: 4765) [more...]
Markdown Emphasis Test Cases
<style> div.markdown table { border: 2px solid black; border-spacing: 0; } div.markdown th { border-left: 1px solid black; border-right: 1px solid black; border-bottom: 1px solid black; padding: 4px 1em 4px; text-align: left; } div.markdown td { border-left: 1px solid black; border-right: 1px solid black; padding: 4px 1em 4px; text-align: left; } </style>
See https://spec.commonmark.org/0.29/#emphasis-and-strong-emphasis
| Id | Source Text | Actual Rendering | Correct Rendering |
|---|---|---|---|
| 1 | *foo bar* |
foo bar | foo bar |
| 2 | a * foo bar* |
a * foo bar* | a * foo bar* |
| 3 | a*"foo"* |
a*"foo"* | a*"foo"* |
| 4 | * a * |
* a * | * a * |
| 5 | foo*bar* |
foobar | foobar |
| 6 | 5*6*78 |
5678 | 5678 |
| 7 | _foo bar_ |
foo bar | foo bar |
| 8 | _ foo bar_ |
_ foo bar_ | _ foo bar_ |
| 9 | a_"foo"_ |
a_"foo"_ | a_"foo"_ |
| 10 | foo_bar_ |
foo_bar_ | foo_bar_ |
| 11 | 5_6_78 |
5_6_78 | 5_6_78 |
| 12 | aa_"bb"_cc |
aa_"bb"_cc | aa_"bb"_cc |
| 13 | foo-_(bar)_ |
foo-(bar) | foo-(bar) |
| 14 | *(*foo |
*(*foo | *(*foo |
| 15 | *(*foo*)* |
(*foo)* | (foo) |
| 16 | *foo*bar |
foobar | foobar |
| 17 | _foo bar _ |
_foo bar _ | _foo bar _ |
| 18 | _(_foo) |
_(_foo) | _(_foo) |
| 19 | _(_foo_)_ |
(_foo)_ | (foo) |
| 20 | _foo_bar |
_foo_bar | _foo_bar |
| 21 | _foo_bar_baz_ |
foo_bar_baz | foo_bar_baz |
| 22 | foo_bar_baz |
foo_bar_baz | foo_bar_baz |
| 23 | _(bar)_ |
(bar) | (bar) |
Strong emphasis
| Id | Source Text | Actual Rendering | Correct Rendering |
|---|---|---|---|
| 1 | **foo bar** |
foo bar | foo bar |
| 2 | a ** foo bar** |
a ** foo bar** | a ** foo bar** |
| 3 | a**"foo"** |
a**"foo"** | a**"foo"** |
| 4 | ** a ** |
** a ** | ** a ** |
| 5 | foo**bar** |
foobar | foobar |
| 6 | 5**6**78 |
5678 | 5678 |
| 7 | __foo bar__ |
foo bar | foo bar |
| 8 | __ foo bar__ |
__ foo bar__ | __ foo bar__ |
| 9 | a__"foo"__ |
a__"foo"__ | a__"foo"__ |
| 10 | foo__bar__ |
foo__bar__ | foo__bar__ |
| 11 | 5__6__78 |
5__6__78 | 5__6__78 |
| 12 | aa__"bb"__cc |
aa__"bb"__cc | aa__"bb"__cc |
| 13 | foo-__(bar)__ |
foo-(bar) | foo-(bar) |
| 14 | **(**foo |
**(**foo | **(**foo |
| 15 | **(**foo**)** |
(**foo)** | (foo) |
| 16 | **foo**bar |
foobar | foobar |
| 17 | __foo bar __ |
__foo bar __ | __foo bar __ |
| 18 | __(__foo) |
__(__foo) | __(__foo) |
| 19 | __(__foo__)__ |
(__foo)__ | (foo) |
| 20 | __foo__bar |
__foo__bar | __foo__bar |
| 21 | __foo__bar__baz__ |
foo__bar__baz | foo__bar__baz |
| 22 | foo__bar__baz |
foo__bar__baz | foo__bar__baz |
| 23 | __(bar)__ |
(bar) | (bar) |