CodeMirror-MathJax icon indicating copy to clipboard operation
CodeMirror-MathJax copied to clipboard

Better line breaking around inline math

Open cben opened this issue 10 years ago • 0 comments

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.

cben avatar Jan 15 '15 14:01 cben