1. The core definition of delimiter run reads:
A delimiter run is either a sequence of one or more * characters that is not preceded or followed by a * character, or a sequence of one or more _ characters that is not preceded or followed by a _ character.
As written, this defines all asterisks and underscores, even singletons, as delimiter runs, but this cannot be. Markdown has never prohibited literal asterisks or underscores, or treated them as prima facie delimiters. Gruber:
But if you surround an * or _ with spaces, it’ll be treated as a literal asterisk or underscore.
The concept of delimiters wrapping text, as Gruber puts it, needs to surface in the definition. Delimiters are by their nature paired entities, else nothing is delimited, so defining a delimiter as a standalone sequence is probably not ideal here.
2. A left-flanking delimiter run is defined as:
A left-flanking delimiter run is a delimiter run that is (a) not followed by Unicode whitespace, and (b) either not followed by a punctuation character, or preceded by Unicode whitespace or a punctuation character. For purposes of this definition, the beginning and the end of the line count as Unicode whitespace.
This is hard to follow. I know this much:
It must not be followed by Unicode whitespace
And it must satisfy at least one other condition. Either:
- It must not be followed by a punctuation character
- Or, it must or must not be preceded by Unicode whitespace — it’s unclear if the negation from punctuation character clause is carried forward to this clause
- Or, it must or must not be preceded by a punctuation character — again, whether the negation is still in force is hazy
It’s also unclear if the condition “preceded by Unicode whitespace or a punctuation character” imposes dual requirements or just one, but that’s due to the possible negation.
From the examples, I assume that the negation only refers to the first clause (“followed by a punctuation…”), and that the intent is to have whitespace before the left-flanking run, not to prohibit it, though I’m not sure why we would care. However, I’m stumped by what the intent is with the preceding punctuation clause.
In any case, the logic should be decomposed so that the negation is clearly bounded to its referent and each condition isolated as appropriate. An easy fix is to put the negation clause at the end of the sentence, instead of the beginning, but a bulleted structure might be best here. Note that having too many restrictions on where we can apply bold or italics might interfere with certain pedagogical use cases where we want to use pronunciation respelling, as is common in dictionaries and teaching materials, or similar intra-string mechanics.