-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Implement passthrough extension #1
Comments
Notes...
|
My 50 cents. As to the config struct, I think it makes sense to start out with the delimiters @jmooring posted in another thread.
@jmooring if would be great if you could somehow manage this issue, but just shout if you need my attention. |
Will do, leaving initial implementation to @j2kun. |
Not sure I understand what's being asked for here. May an inline equation be split across lines within a paragraph?
This seems fine to me, and if so, I don't see why the following wouldn't be feasible (or why the implementation would be any different)
|
I don't think so, but test against other implementations (GitHub gist, GitLab snippet). With a GitHub gist this is OK:
But this is not:
And neither of the above work with GitLab snippets. Maybe you can find a spec somewhere, or test against other implementations (Obsidian, Typora, VS Code, etc.). Think about where the content (not just your content) is likely to originate. But I get your point... a single newline in markdown does not signify the end of a paragraph. GitHub gist example: https://gist.github.com/jmooring/f649aae89a2047e44541de2e3001fb0b GitLab snippet example: https://gitlab.com/-/snippets/3637801 |
Both "split" examples above work fine with the VS Code markdown preview, so maybe it's OK. My concern is false positives, which is why a spec would be great. Both "split" examples also work with both KaTeX and MathJax, so I think you're right. |
My context is all coming from uses of MathJAX, KaTeX, and others in places like mathoverflow.com, math.stackexchange.com, and in normal LaTeX documents, where splitting mathmode across single-line breaks is always accepted (and double-line breaks are not). They also support using "block" mathmode in a paragraph, like
And this would render the I'm not aware of any standard spec, except LaTeX itself as a reference implementation. My plan is to test against KaTeX or MathJAX as a reference implementation. |
Sounds good. I've added and organized test cases to the repo/branch mentioned above:
|
I started implementing it, then got confused that the following tests are passing without any extension: https://github.com/j2kun/hugo-goldmark-extensions/blob/main/passthrough/passthrough_test.go Any idea why that might be? Do I need to configure the goldmark parser a certain way? |
You need to test with LaTeX that is mangled when the markdown is converted to HTML. Please look at these test cases:
Use the CommonMark demo to run quick tests. The example that you've used in your tests is not modified when processed as markdown: But this one is mangled: For your reading pleasure: |
Continuing from gohugoio/hugo#10894
I'm happy to take a first pass at the implementation
The text was updated successfully, but these errors were encountered: