Skip to content

Better line breaking around inline math #32

Open
@cben

Description

@cben

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions