Escape the first underscore by putting a backslash before it. (Why does the MarkDown italics mark-up work even within words, anyway? I think the situations where someone would want to italicize only part of a word are far fewer than those where one would want to use a word with an underscore in the middle of it.)
Why does the MarkDown italics mark-up work even within words, anyway? I think the situations where someone would want to italicize only part of a word are far fewer than those where one would want to use a word with an underscore in the middle of it.
I would think a lot less of a language that introduced an arbitrary limitation on its syntax like that. Italics of parts of a word come up occasionally and bold letters of a word more frequently than that. The language arbitrarily deciding it doesn’t want to execute the formatting commands unless you do whole words the same would be irritating, confusing and inelegant.
And it makes the rare-but-still-occasionally-desired case doable without escaping into HTML (which is not possible in LW’s no-HTML subset of Markdown).
You’d only need, whenever you see an underscore, to check whether the previous character is whitespace (or punctuation, e.g. a left parenthesis). Arundelo’s point seems more valid to me (though you might allow to escape spaces, e.g. _n_\ th… but that’d be more complicated).
Escape the first underscore by putting a backslash before it. (Why does the MarkDown italics mark-up work even within words, anyway? I think the situations where someone would want to italicize only part of a word are far fewer than those where one would want to use a word with an underscore in the middle of it.)
I would think a lot less of a language that introduced an arbitrary limitation on its syntax like that. Italics of parts of a word come up occasionally and bold letters of a word more frequently than that. The language arbitrarily deciding it doesn’t want to execute the formatting commands unless you do whole words the same would be irritating, confusing and inelegant.
It’s probably less work to read character-by-character than to split on words and read the first and last character of each.
And it makes the rare-but-still-occasionally-desired case doable without escaping into HTML (which is not possible in LW’s no-HTML subset of Markdown).
You’d only need, whenever you see an underscore, to check whether the previous character is whitespace (or punctuation, e.g. a left parenthesis). Arundelo’s point seems more valid to me (though you might allow to escape spaces, e.g.
_n_\ th
… but that’d be more complicated).True! I do not know why MarkDown italics works within words.