Steps to reproduce
Paste this into a note and open Reading view:
a * foo bar*
a ** b ** c
foo_bar_
__foo, __bar__, baz__
Did you follow the troubleshooting guide?
Yes (reproduced in the sandbox vault, no community plugins).
Expected result
As the CommonMark spec (0.31.2) renders them:
| Markdown | CommonMark HTML | Spec example |
|---|---|---|
a * foo bar* |
a * foo bar* (a * followed by a space cannot open emphasis) |
351 |
a ** b ** c |
a ** b ** c |
same rule |
foo_bar_ |
foo_bar_ (a _ inside a word neither opens nor closes) |
360 |
__foo, __bar__, baz__ |
<strong>foo, <strong>bar</strong>, baz</strong> |
389 |
Actual result
| Markdown | Reading view HTML |
|---|---|
a * foo bar* |
a <em> foo bar</em> |
a ** b ** c |
a <strong> b </strong> c |
foo_bar_ |
foo<em>bar</em> |
__foo, __bar__, baz__ |
<strong>foo, </strong>bar<strong>, baz</strong> |
Reading view pairs * and _ runs first come first served, without CommonMark’s left- and right-flanking checks, its rule for _ inside words, or its nesting rules. Words in other scripts are affected the same way (пристаням_стремятся_ gives пристаням<em>стремятся</em>, example 362).
Environment
SYSTEM INFO:
Obsidian version: 1.14.5
Installer version: 1.14.4
Operating system: Windows 11 Pro 10.0.26300
Login status: not logged in
Language: en
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: on
RECOMMENDATIONS:
none
Sandbox vault, no community plugins, default theme and settings.
Additional information
Measured on the CommonMark 0.31.2 spec examples in Reading view (default settings). Other examples with the same cause: 352-354, 358-359, 366, 368-369, 371, 373, 375, 379-380, 383-388, 391-392, 397-398, 400-402, 407-409, 413-418, 425-427, 432, 437, 439, 443-447, 449, 451, 455-459, 464-468, 470-472.
Related: Commonmark-compliance: Reader should NOT parse intra word underscore (CJK and Cyrillic) covers the _-inside-a-word part for CJK and Cyrillic text. This report adds the Latin cases, the spaces-inside-delimiters cases and nesting.
foo_bar_baz (an _ pair fully inside a word) is left alone, which is right, but __a__b still gives <strong>a</strong>b.