Summary
The serializer escapes a leading * that the strong run beside it already keeps literal. ***text** parses as a literal asterisk followed by strong emphasis, and saving it writes \***text**. The backslash changes nothing: the unescaped form reparses to the same document, measured below.
This is the class #252, #256, #257, #258, #271, #289, #292, and #293 removed, reaching a run the pairing leaves over. It is also the serializer disagreeing with itself: the same save drops an unnecessary escape from a link destination and from a text run, then adds one here.
Steps to reproduce
- Open a document containing
***text**.
- Save it without editing.
- Read the file.
Expected behavior
***text**. The three-asterisk run spells one literal asterisk and a two-asterisk opener, and the run itself is what keeps the leftover literal, so no backslash is needed to hold it.
Actual behavior
Measured against 83033d4b by driving the editor mount used by the plugin tests, on corpus/commonmark/emphasis.md line 59.
| Document |
Saved |
***asterisk combination missing one closer** |
\***asterisk combination missing one closer** |
The escape is redundant, not merely cosmetic. Both spellings parse to the same document:
| Source |
Document |
\***asterisk combination missing one closer** |
literal * followed by strong asterisk combination missing one closer |
***asterisk combination missing one closer** |
literal * followed by strong asterisk combination missing one closer |
Closure and convergence both hold today, so neither the corpus round-trip guard nor the document-preservation guard can see this. What it costs is byte identity for corpus/commonmark/emphasis.md.
The same save normalizes in the opposite direction elsewhere in the corpus, which is what makes this a defect rather than a house style: [Escaped](garden\(section\).md) is written back as [Escaped](garden(section).md), and a run of escaped ASCII punctuation is written back with only the escapes that carry weight.
Related context
Done when
Notes, logs, screenshots
Out of scope
- The underscore spelling,
___text__, which was not measured. Confirm whether it behaves the same before deciding whether the fix covers one delimiter or both.
- Escapes dropped from a link destination and from a text run, which follow from an escape being derived rather than owned and are not defects.
Summary
The serializer escapes a leading
*that the strong run beside it already keeps literal.***text**parses as a literal asterisk followed by strong emphasis, and saving it writes\***text**. The backslash changes nothing: the unescaped form reparses to the same document, measured below.This is the class #252, #256, #257, #258, #271, #289, #292, and #293 removed, reaching a run the pairing leaves over. It is also the serializer disagreeing with itself: the same save drops an unnecessary escape from a link destination and from a text run, then adds one here.
Steps to reproduce
***text**.Expected behavior
***text**. The three-asterisk run spells one literal asterisk and a two-asterisk opener, and the run itself is what keeps the leftover literal, so no backslash is needed to hold it.Actual behavior
Measured against
83033d4bby driving the editor mount used by the plugin tests, oncorpus/commonmark/emphasis.mdline 59.***asterisk combination missing one closer**\***asterisk combination missing one closer**The escape is redundant, not merely cosmetic. Both spellings parse to the same document:
\***asterisk combination missing one closer***followed by strongasterisk combination missing one closer***asterisk combination missing one closer***followed by strongasterisk combination missing one closerClosure and convergence both hold today, so neither the corpus round-trip guard nor the document-preservation guard can see this. What it costs is byte identity for
corpus/commonmark/emphasis.md.The same save normalizes in the opposite direction elsewhere in the corpus, which is what makes this a defect rather than a house style:
[Escaped](garden\(section\).md)is written back as[Escaped](garden(section).md), and a run of escaped ASCII punctuation is written back with only the escapes that carry weight.Related context
docs/decisions.mdunderPreserve the form a file was written in; the escape rules underOffer the escape gesture only where the conversion exists, which record that nothing durable is stored for an escape and that it is derived from the text and the serializer's safety check.Done when
corpus/commonmark/emphasis.mdloses this difference, or the reason it cannot is recorded.Notes, logs, screenshots
Out of scope
___text__, which was not measured. Confirm whether it behaves the same before deciding whether the fix covers one delimiter or both.