Giter VIP home page Giter VIP logo

Comments (6)

wooorm avatar wooorm commented on May 26, 2024

This project focusses on standards, not on custom non-standard needs.

Disabling escaping would break everything. Allowing to override escape would break everything.

I don’t think this feature would be enough for you to generate a string for Svelte.
Also sounds like you don’t generate things for Svelte, but for MDsveX. Which is even more different.

What do you want to generate? Why use this project for that? Why not build your own project for Svelte/MDsveX’s format?
Why not use MDX itself, which also works with Svelte?

from hast-util-to-html.

johnhooks avatar johnhooks commented on May 26, 2024

I am using this library to generate strings of highlighted code elements from MDSveX fenced code blocks. I'm using hastscript to build the hast AST from Shiki generated tokens. It's not necessarily generating anything MDsveX or Svelte specific, but since its processed by MDsveX after being generated, braces need to be escaped.

Everything is currently working beautifully, but I would like more control over escaping special characters. Like I said I thought adding subset would be better and wasn't sure why the option was disabled. I didn't believe I was inquiring on something that was non-standard, the ability to control which characters of a text value in HTML to escape seemed like it would be a common need.

from hast-util-to-html.

ChristianMurphy avatar ChristianMurphy commented on May 26, 2024

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.
A pipeline which would likely make more sense for your use case.

Or alternatively:

In both cases, using svast-stringify should guarantee compatibly with MDsveX, since it is designed/built to implement MDsveX's own internal AST representation and will include escapes expected by MDsveX.

from hast-util-to-html.

johnhooks avatar johnhooks commented on May 26, 2024

@ChristianMurphy and @wooorm thanks for the advice. I'll take a look at building a svast tree, rather than hast.

from hast-util-to-html.

github-actions avatar github-actions commented on May 26, 2024

Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.

from hast-util-to-html.

github-actions avatar github-actions commented on May 26, 2024

Hi team! Could you describe why this has been marked as external?

Thanks,
— bb

from hast-util-to-html.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.