-
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
Expressions inside html within markdown are not rendered #7
Comments
You can think of this as a feature request. This is absolutely necessary in my case, because I have a lot of HTML markup on my pages, for example to create collapsible blocks with |
Hello, thank you for creating a issue. This is inherited behavior from kramdown. Kramdown uses HTML blocks as whole and does not render their contents. I am not sure if I it is a good idea to make jektex behave differently then parser it depends on. I reproduced your issue like this: ---
title: "Jektex test"
---
Lorem ipsum dolor sit amet, consectetur adipiscing elit. $$e^{i\pi} + 1 = 0$$ Suspendisse et molestie quam.
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
$$
i\hbar\frac{\partial}{\partial t} \Psi(\mathbf{r},t) = \left [ \frac{-\hbar^2}{2\mu}\nabla^2 + V(\mathbf{r},t)\right ] \Psi(\mathbf{r},t)
$$
Suspendisse et molestie quam.
<div>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. $$e^{i\pi} + 1 = 0$$ Suspendisse et molestie quam.
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
$$
i\hbar\frac{\partial}{\partial t} \Psi(\mathbf{r},t) = \left [ \frac{-\hbar^2}{2\mu}\nabla^2 + V(\mathbf{r},t)\right ] \Psi(\mathbf{r},t)
$$
Suspendisse et molestie quam.
</div> SolutionAs per kramdown documentation you can explicitly declare block to render using So this:
What do you think? Are you satisfied with this solution? |
Thanks for the fast answer. I'm used to not getting help with issues but you're so reasonable. It's a very good idea. I agree with the reason you don't want to change behavior. I followed your advice and added this attribute. ---
layout: page
title: test
---
$$\alpha$$
<div markdown="1">$$\beta$$</div>
I looked at the code and see that you get the entire page | document, convert it to string and then extract the expressions using In this case, it's not clear why a separate |
Another suggestion would be to support passing the
Now my autorender is configured using this to process $ notation. I think this could be a compromise solution. But it mightn't be worth the time if I can get |
It seems to be disgustingly unstable. After several restarts without changing the markup, I got a different result (also not satisfactory): It seems to work when I add line breaks between the opening and closing tags. I checked whether the attribute applies to nested elements. And the answer is no. It turns out that I'll have to set this attribute on each element directly containing $$. And that doesn't particularly suit me. Any suggestions on how to fix the incorrect render? What do you think about providing the ability to specify delimiters instead of changing the notation handling code? |
Oh. I apologize. It seems I was a little hasty. This option's only for the In order to use it, you will have to include autorender.min.js in addition to katex.min.js, which you'll obviously want to avoid, as well as hard code behavior inconsistent with kramdown. This all looks hopeless and seems to really require major changes to the code to start looking for $$ that kramdown doesn't convert to LaTeX notation, or to provide the ability to specify delimiters, similar to the auto-render extensions. |
renders to
The text was updated successfully, but these errors were encountered: