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
KaTeX Expressions aren't Included in Headings #112
Comments
Interesting! I'm thinking I could use a blacklist approach instead of the current whitelist approach, e.g. doing This yields the same output with all my tests using native markdown-it tokens but in the case of the KaTeX plugin, that would include the expression as well. This would be a breaking change though and that behavior might be undesirable with other plugins, so I guess it's safer to leave it as is and introduce a configuration option... Probably something like: md.use(anchor, {
getTokensText: tokens => tokens.filter(t => t.type !== 'html_inline' && t.type !== 'image').map(t => t.content).join('')
}) I'll give it some more thoughts and get back to you :) |
Awesome, that would be great! |
|
Awesome! Thank you very much for your effort! 😄 |
Currently, KaTeX expressions inside of headings aren't part of the anchors.
I'd love to either have an option for configuring additional token-types to include in anchors or to have the token type
math_inline
added to this filter:markdown-it-anchor/index.js
Line 51 in 7f947ce
This would allow users to make anchors look more like the ones generated by GitHub.
Thanks for your great work 😄
The text was updated successfully, but these errors were encountered: