Delimiter run definitions need clarification

The notion of a “delimiter run” is a technical notion, used to define what we really care about, which is emphasis and strong emphasis. It is harmless if a standalone string of *** with spaces on each side counts as as delimiter run, since it will neither be left-flanking nor right-flanking, so no emphasis will be triggered.

One could define “delimiter run” differently, so that only left-flanking and right-flanking strings of delimiters count as delimiter runs. But this would actually make the definitions more complicated, and because “delimiter run” is a technical notion, we can define it in the way that is most convenient for the overall definition of emphasis.

The intent here is:

(NOT followed by unicode whitespace) AND (EITHER (NOT followed by punctuation) OR (preceded by whitespace or punctuation)

I thought that was the natural reading (because with the “either” after (b), you can’t really get the negation to scope over both disjuncts. But I’m open to suggestions about how it might be made less confusing.

The basic idea is that a delimiter run becomes left-flanking when the character to its right ranks higher that the character to its left on the following scale:

non-space & non-punctuation > punctuation > space

The logical definition just spells this out. I think the “ranking” idea is more intuitive and had this in a previous version of the spec, if I recall. But some implementers complained that it would be easier just to give the simple Boolean condition. Maybe we should rethink that.

A lot of thought and experimentation has gone into this part of the spec. Simpler ideas yield too many intuitively wrong cases. Note that * emphasis can be used intra-word, but _ cannot. So *em*phasis, not em*phas*is works as you’d expect.

1 Like