GithubHelp home page GithubHelp logo

Comments (2)

wooorm avatar wooorm commented on August 30, 2024 1

That’s a good question. We talked about this a while back (syntax-tree/hast#3).

There’s four main differences:

  1. The syntax tree is different: hast is very convenient to work with. hast is based on unist, which means there’s many tools to work with the syntax tree
  2. The API is different. rehype is based on unified, which is also used for markdown in remark, and natural language, in retext. I think unified is really useful. There’s also “bridges” to transform to remark or retext, keeping positional info intact, which means that linting messages are kept intact.
  3. PostHTML uses htmlparser2 (by default?), rehype uses parse5 (by default)
  4. The ecosystem is different: although there aren’t many plugins for rehype, the plugins that exist are custom made for rehype. PostHTML seems to often stringify to HTML, post that to an API or CLI, and parse the resulting HTML. On the other hand, take remark-format and rehype-minify, both are custom made for rehype, very good, work fast as they don’t need to stringify/parse in between, and keep position information intact (very useful for linting, source maps, etc).

...possible more though...

Does that help?

from rehype.

notpushkin avatar notpushkin commented on August 30, 2024

Definitely. Thanks!

from rehype.

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.