Open
Description
KaTeX has this clever tweak which IIUC avoids breaks between math & adjacent punctuation:
white-space: nowrap;
.katex-inner {
// Making .katex inline-block allows line breaks before and after,
// which is undesireable ("to $x$,"). Instead, adjust the .katex-inner
// style and put nowrap on the inline .katex element.
display: inline-block;
}
Will it work with CodeMirror?
CM's markText() requires widgets to be inline; I'm currently passing inline-block, which works fine, so this should also work.
Just need to check that nowrap
doesn't confuse CM.