-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add support for % comments #20
Comments
mrrh? |
Poking this. It turns out the kramdown engine turns
The intention is that it gets wrapped to properly escape the < sign, and the wrapping gets commented out in the rendering. kramdown is the main markdown engine for Github Pages, so this is a barrier for setting up KaTeX on blogs hosted there. |
That's clever. CDATA isn't even valid in HTML5 though (only SVG and MathML): https://html.spec.whatwg.org/#cdata-sections. |
Kramdown has a workaround now. But KaTeX should still fix this. |
I was thinking of pre-processing the input to remove the comments, but we probably don't want to do that b/c then an error reporting would have the wrong position information. |
Can't this be done in the Lexer? Just add comment pattern to the regex, but don't return upon a comment match. |
I think |
Perhaps |
My "mrrh?" comment was ambivalence about the correct answer. I'm not sure it makes sense to allow it at the end of an expression – since you can't do |
|
The fact that this exists feels like a small argument in favor of not supporting ending comments: |
We could change that to
😛 |
Yes, but only if you're expecting this behavior! The fact that it isn't that already indicates that you wouldn't. Someone else might equally try to build a web writing interface that accepts KaTeX and turns into a full TeX document later and be bitten by this. |
We could have an option to allow comments without newlines, but have the default be strict LaTeX compliance. |
In Perseus (or auto-render), I also wouldn't want typing What's the value in allowing comments without newlines? If you really want to do that you can always just tack on a newline to the input expression when calling KaTeX. |
IMHO, if I guess I can't imagine a setting where |
I'm okay with that too. The best justification I could come up with is that it would all writing comments in our test app, but that isn't much of a justification. Our test app should be modified to use a |
Yeah, it sounds like allowing a comment to end a math expression would not be expected behavior. I rescind my suggestion. |
I'm going to give this a shot. |
@kevinbarabash You should test spacing behavior: \text{hello% comment
world} should parse like \text{hello% comment
world} (oops, moving this discussion to #884) |
No description provided.
The text was updated successfully, but these errors were encountered: