-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Desktop: switch to plain markdown in codemirror #3448
Conversation
While looking at the final part of #3440 I realize that everything was more related than I realized and the cleanest solution was to integrate them all, my final commit reflects this by adding a new editor mode (joplin-markdown) which supports katex blocks. One unfortunate side affect of this change is that when the user starts typing in a new katex block ( |
// and support for katex math blocks | ||
export default function useJoplinMode(CodeMirror: any) { | ||
CodeMirror.defineMode('joplin-markdown', (config: any) => { | ||
const stex = CodeMirror.getMode({ inMathMode: true }, 'stex'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like you use a mode specific for math expressions, so I'm wondering can we get this highlighted as well? On this page, they have the highlighting but I'm not sure if it can be done when it's within Markdown. It would be great if it was though!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll take another stab at this. It should be as easy as including parseDelimiter: true
but that doesn't seem to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be as easy as including parseDelimiter: true
Yes that's what I was wondering. If it's as easy as switching a flag on, then let's do it but if it's more complicated don't worry about it, just let me know either way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It turned out to be as easy as switching a flag correctly
@laurent22 his is ready to go now, sorry about the delay on this. I had a hunch that it was easy but didn't have time to devote to it. You'll notice that it was a matter of actually passing in the options correctly, this is unfortunately a less than intuitive aspect of codemirror 5. |
This removes gfm in favor of plain markdown (with a couple extensions).
This fixes the issue report by @yadayadaydadaa in the comments of #3440