-
Notifications
You must be signed in to change notification settings - Fork 138
feat: change markdown standard to GFM #812
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
base: master
Are you sure you want to change the base?
Conversation
Hello @tachyonicClock! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2024-09-04 22:52:54 UTC |
e060de8
to
af36253
Compare
Change markdown standard to Github Flavored Markdown (GFM) replacing Pandoc's default markdown. This is consistent with the Jupyter Notebook markdown cells and should improve compatibility.
af36253
to
4c652b6
Compare
Thanks for this PR! I wasn't aware that Jupyter uses GFM. First I thought this was changed recently, but apparently this has been supported for a long time! So I'm all for also using it in
This might not be a full list, for now I only looked at |
Drive-by comment: have you considered also making a similar PR in jupyter nbconvert ? Both projects unfortunately do not share the pandoc invocation, but I think most users would expect them to behave the same way (at least I did). |
In an effort to close my outstanding pull requests, I took another look at this. Unfortunately, despite what nbformat says about markdown being Github-flavoured markdown (GFM) as implemented in marked.js, the truth is that Jupyter Lab uses a hybrid of GFM and a custom parser that identifies equations. In summary this is difference between GFM and Jupyter's handling of equations:
The relevant source code is in // Separate math from normal markdown text.
const parts = removeMath(source); // <- This is their custom parser that identifies equations.
// Convert the markdown to HTML.
html = await markdownParser.render(parts['text']);
// Replace math.
html = replaceMath(html, parts['math']); // <- This adds the equations back with markers for MathJax Equations in Different MarkdownsGiven that Jupyter deviates from GFM how do different markdown/notebooks handle equations. I used this file to test them.
The "GFM Markdown" row indicates whether non-equation elements render like GFM. It is important because, as you can see, the way lists render is quite different. What do we do?Its all a bit of a mess. My opinion is that Maybe we could add a "jupyter-flavoured-gfm" extension to pandoc or add a pre-processing step that converts Jupyter style equations to GFM compliant ones. Either approach would need to match Jupyter's |
Change markdown standard to Github Flavored Markdown (GFM) replacing Pandoc's default markdown. This is consistent with the Jupyter Notebook markdown cells and should improve compatibility (https://nbformat.readthedocs.io/en/latest/format_description.html#markdown-cells).