-
-
Notifications
You must be signed in to change notification settings - Fork 19
Request more control over escaping #35
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
Comments
This project focusses on standards, not on custom non-standard needs. Disabling escaping would break everything. Allowing to override I don’t think this feature would be enough for you to generate a string for Svelte. What do you want to generate? Why use this project for that? Why not build your own project for Svelte/MDsveX’s format? |
I am using this library to generate strings of highlighted code elements from MDSveX fenced code blocks. I'm using Everything is currently working beautifully, but I would like more control over escaping special characters. Like I said I thought adding |
HTML and Svelte templates are related but different, I'd agree with @wooorm that this project focuses HTML, adding Svelte specific escapes doesn't make sense.
Or alternatively:
In both cases, using |
@ChristianMurphy and @wooorm thanks for the advice. I'll take a look at building a |
Initial checklist
Problem
I'm using
toHtml
to stringify highlightedcode
elements and then use them in MDsveX, a Svelte version of MDX. Though I need to escape[{}`]
because those are special characters in Svelte. I was attempting to escape them at the base of the AST on the text values. But I they were getting double escaped. I then figured outtoHtml
escapes&
.Currently, I'm running the hast through
toHTML
and then escaping the other characters I need. Though this seems brittle and also much less targeted than having control at theText.value
level.Solution
toHtml
escape
option that allows overriding the default.Alternatives
subset
what do you think?
The text was updated successfully, but these errors were encountered: