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

MDsveX + Katex #113

Closed
cesutherland opened this issue Aug 8, 2020 · 3 comments
Closed

MDsveX + Katex #113

cesutherland opened this issue Aug 8, 2020 · 3 comments

Comments

@cesutherland
Copy link

Awesome project! I've been impressed by the expressiveness of Svelte's reactive-ness, and you've got a beautiful repl here.

I'd like to report an issure regarding integration with katex, where < signs result in a Expected valid tag name error. Katex is correctly transformed. This is related to or the same root cause as #76 .

I have a tidy little test case here.

svelte config:

  svelte({
    extensions: [".svelte", ".svx"],
    preprocess: mdsvex({
      remarkPlugins: [
        remarkMath,
      ],
      rehypePlugins: [
        [rehypeKatex, {output: 'html'}],
      ],
    })
  })

svx input:

# Header

Some text.

## Header 2

A function:

$$
f(x) = \sum_{n=0}^{\infty}a^ncos(b^n \pi x)
$$

where $$0 < a < 1$$, $$b$$ is a positive odd integer, and $$ab > 1 + \frac{3}{2}\pi$$.

error:

[!] (plugin svelte) ParseError: Expected valid tag name
test.svx
59: ></span><span
60:   class="mrel"
61: ><</span><span
      ^
62:   class="mspace"
63:   style="margin-right:0.2777777777777778em;"
@pngwn
Copy link
Owner

pngwn commented Aug 8, 2020

Yeah, this is indeed the same issue as #76. Appreciate the test case!

I do have a fix for this but it is a little involved. I have something in the works that will address a number of formatting/ encoding issues as well as a host of other benefits but it is quite foundational and will take some time given my limited schedule.

@cesutherland
Copy link
Author

@pngwn appreciate it! I'll keep my eye out.

@pngwn
Copy link
Owner

pngwn commented Aug 14, 2020

This comment pretty much covers this issue as well. With one difference, this case should be easier to optimise since it uses custom syntax, there is at least the possibility of escaping the conflicting characters automatically. This doesn't depend on precisely how the plugin itself generates it's output but possible is better than nothing. :D

I am going to close this issue and keep the older one open to keep track. I'll reference this from that issue.

@pngwn pngwn closed this as completed Aug 14, 2020
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