I see that in the asciidoc.kak file, the regex of the highlighter for italicized text is:
\b_[^\n]+?_\b
meaning that between the underscore delimiters, the text to be italicized cannot comprise a line return, \n
.
Question: why prohibiting line returns? AFAIK, the asciidoc spec allows italicized (or bold) text to span multiple lines. Was this done for performance reasons (e.g., to avoid scanning a 1GB asciidoc document with a single stray underline)?
Suggestion: what about allowing italicized text over multiple lines, while fixing a reasonable limit to how many characters should be scanned before giving up on a stray underline? For example, with a limit of 3 * 80 = 240 characters (meaning at most 3 lines of 80 chars each), the regex for italicized text would be:
\b_.{1,240}?_\b
This would allow a (long) journal title in italics, for example, to span over 2 or 3 lines.