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

Add support for importing math expressions from Markdown #4408

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

dousha
Copy link
Contributor

@dousha dousha commented Nov 7, 2023

The ability to typeset math expressions in markdown is now considered essential. Many other markdown-based note-taking software supports using TeX-like expressions for this, as demonstrated in #4387.

This PR adds proper support for importing math expressions from Markdown by leveraging the extension functionality of marked. A set of tokenizers is added to marked to parse these expressions and convert them into KaTeX-compliant HTML output.

Closes #4387.

@dousha
Copy link
Contributor Author

dousha commented Nov 10, 2023

Should #4417 be merged, we can just switch to using marked-katex-extension, which lists katex as a dependency.

@zadam
Copy link
Owner

zadam commented Nov 12, 2023

@dousha #4417 has been merged. Do you need to modify your PR now?

@dousha
Copy link
Contributor Author

dousha commented Nov 13, 2023

There are some modifications made to the original marked-katex-extension. Notably the ability to use \( \) and \[ \] for math expressions. I'll merge these modifications to marked-katex-extension first.

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

Successfully merging this pull request may close these issues.

(Bug report) math formula format incorrectly
2 participants