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

Option to support multiple delimiters #40

Closed
tlylt opened this issue Feb 11, 2022 · 2 comments
Closed

Option to support multiple delimiters #40

tlylt opened this issue Feb 11, 2022 · 2 comments

Comments

@tlylt
Copy link

tlylt commented Feb 11, 2022

Hi,
I am using markdown-it-texmath in a project(Thank you!) with 'bracket' as the delimiter. Would like to ask if it is currently possible for users to specify more than one of the supported delimiters to use interchangeably.
E.g. possible to do something like delimiters: ['dollars', 'brackets'] ?

const tm = require('markdown-it-texmath');
const md = require('markdown-it')({html:true})
                  .use(tm, { engine: require('katex'),
                             delimiters: 'dollars', 
                             katexOptions: { macros: {"\\RR": "\\mathbb{R}"} } });

Thanks!

@tlylt
Copy link
Author

tlylt commented Mar 12, 2022

Found a convenient but somewhat hacky solution of requiring the plugin twice.

markdownIt.use(require('markdown-it-mark'))
	//...
  .use(require('markdown-it-texmath'), { engine: katex, delimiters: 'brackets' })
  .use(require('markdown-it-texmath'))

@tlylt tlylt closed this as completed Mar 12, 2022
@goessner
Copy link
Owner

Support of simultaneous use of multiple delimiters now with Version 1.0 . Thanks for proposing.

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