Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiplex + markdown header issue. #3535

Closed
Carreau opened this issue Sep 17, 2015 · 2 comments
Closed

Multiplex + markdown header issue. #3535

Carreau opened this issue Sep 17, 2015 · 2 comments

Comments

@Carreau
Copy link
Contributor

Carreau commented Sep 17, 2015

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 !

@marijnh
Copy link
Member

marijnh commented Sep 21, 2015

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.

@marijnh marijnh closed this as completed Sep 21, 2015
@Carreau
Copy link
Contributor Author

Carreau commented Sep 21, 2015

Thank you very much !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants