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

Refactor math formulae support #1940

Merged
merged 9 commits into from
May 29, 2022
Merged

Conversation

tlylt
Copy link
Contributor

@tlylt tlylt commented May 28, 2022

What is the purpose of this pull request?

  • Documentation update
  • Bug fix
  • Feature addition or enhancement
  • Code maintenance
  • Others, please explain:

Overview of changes:

Related to #1754
With the latest update in markdown-it-texmath, it is now possible to specify a list of delimiters. Hence, this PR aims to refactor the code to take advantage of the new feature.

  • Support dollars and brackets out of the box for math formulae display
  • Repurpose the previous texWithDollars plugin into mathDelimiters, for additional support of other delimiters (optional and only for people who actually need it)
  • Update documentation
  • Update functional tests
  • One slightly unrelated change to print out the error stack trace when a plugin fails to load properly, for a better debugging experience

Anything you'd like to highlight / discuss:
nil

Testing instructions:
See documentation and functional tests

Proposed commit message: (wrap lines at 72 characters)
Refactor math formulae support

The dollars delimiter for math formulae is currently supported via
a plugin because the markdown-it-texmath package does not
allow for more than one delimiter.

With the latest version update, the markdown-it-texmath package
can now support multiple delimiters.

Let's update the code to specify dollars as a supported delimiter
out of the box for math formulae. Let's also repurpose the
texWithDollars plugin to mathDelimiters for any additional
delimiter addition if any user is interested.

Users can now use dollars and brackets (two popular) delimiters
for math formulae without any configurations.


Checklist: ☑️

  • Updated the documentation for feature additions and enhancements
  • Added tests for bug fixes or features
  • Linked all related issues
  • No unrelated changes

docs/userGuide/syntax/mathformulae.md Outdated Show resolved Hide resolved
docs/userGuide/plugins/mathDelimiters.md Outdated Show resolved Hide resolved
packages/core/src/plugins/mathDelimiters.js Outdated Show resolved Hide resolved
@ang-zeyu ang-zeyu mentioned this pull request May 28, 2022
4 tasks
@ang-zeyu
Copy link
Contributor

Lgtm otherwise 👍, though if possible @jonahtanjz could take a look as well in case I'm missing anything from the first PR.

Copy link
Contributor

@jonahtanjz jonahtanjz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor documentation nits. Implementation wise looks good 👍

docs/userGuide/plugins/mathDelimiters.md Outdated Show resolved Hide resolved
docs/userGuide/plugins/mathDelimiters.md Outdated Show resolved Hide resolved
Co-authored-by: Jonah Tan <47470981+jonahtanjz@users.noreply.github.com>
Copy link
Contributor

@jonahtanjz jonahtanjz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@jonahtanjz jonahtanjz added this to the 4.0 milestone May 29, 2022
@jonahtanjz jonahtanjz merged commit a9285e7 into MarkBind:master May 29, 2022
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.

3 participants