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

Optional support to ignore code in tex fences #504

Open
j2kun opened this issue Nov 18, 2018 · 2 comments
Open

Optional support to ignore code in tex fences #504

j2kun opened this issue Nov 18, 2018 · 2 comments

Comments

@j2kun
Copy link

j2kun commented Nov 18, 2018

Cf. gohugoio/hugo#5431 for context.

In brief, I'd like to contribute a feature whereby one can configure blackfriday to ignore code between latex fences (specified by the user, and disabled by default). The central issue is that the renderer will insert emphasis in the middle of tex formulas, such as $x_1^2 + x_2^2$, interfering with the later tex rendering (e.g., mathjax).

The standard tex equation fences are $$ for inline, and \[ \] or $$ $$ for multiline. I would be happy to have hard-coded fixes for these (and only these) equation fences, but I imagine the maintainer of this project would prefer something less hacky. So I propose allowing the user to instead specify any set of open/close fences to skip when processing.

Multiline would be implemented similarly to the div check here 1, and the paragraph content would be passed through unchanged. Inline would be presumably implemented here 2 (not entirely sure).

I'm happy to add this feature, but might need a bit of hinting so as to not waste a reviewer's time, especially for the preferred method of configuring which fences to ignore.

@j2kun
Copy link
Author

j2kun commented Dec 30, 2018

I'm not sure who the correct maintainer is: perhaps @rtfb based on recent commits? Have you had a chance to think about this proposal? I would, of course, add the feature to your standards.

@ghbrown
Copy link

ghbrown commented Jun 7, 2023

I agree this would be a useful feature. However, now that Hugo is using the Goldmark processor do we still want to keep this open?

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