Skip to content
This repository was archived by the owner on Apr 16, 2026. It is now read-only.
This repository was archived by the owner on Apr 16, 2026. It is now read-only.

Multiplex + markdown header issue. #3535

Closed

Description

@Carreau

Hi there,

I have an edge case issue with Markdown & multiplex, I might be doing things wrong.
Basically I have a markdown/latex multiplexed mode, and the following sequence seem to be parsed wrongly by the mode:

# Header

$some math$ text that should not be header but appear to be

I define my mixed mode as follow:

CodeMirror.multiplexingMode(
    CodeMirror.getMode(config, "gfm"),
    {open: "$", close: "$",
     mode: CodeMirror.getMode(config, "stext"),
     delimStyle: "delimit"}
  )

and I made a minimal reproductible example here: Carreau@252ba18

And here is a screenshot if it can be clearer.
screen shot 2015-09-17 at 11 11 55

I'm not sure if it is bug/feature/unattended side effect/me missuderstandding mixed mode

Thanks !

Activity

  1. marijnh commented on Sep 21, 2015

    @marijnh
    Member

    The markdown doesn't see the start of the line, because that part of the stream is multiplexed to the stex mode. I've pushed a patch that makes the markdown mode more robust in this case, but in general, multiplexing has its dangers -- it'll hide part of the stream from the multiplexed modes, which some modes don't handle well.

  2. Carreau commented on Sep 21, 2015

    @Carreau
    ContributorAuthor

    Thank you very much !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions