Skip to content

How to parse HTML string into HAST and vice versa #236

Answered by ChristianMurphy
Ahmedsaed asked this question in Q&A
Discussion options

You must be logged in to vote

Welcome @Ahmedsaed! 👋

TL;DR do server side rendering through next and apply compression to the output.

I am using nextjs for my project and I don't want to pass a large string of HTML data to the component as a prop. I instead want to parse it into an intermediate (light weight) form

It isn't really lighter weight versus rendering the HTML.
See the discussion at https://github.com/orgs/unifiedjs/discussions/188#discussioncomment-2466114

rendered to reduce bandwidth and optimize performance

JSON isn't compression, gzip and brotli are compression


To answer the XY question

The need to provide a compiler to be able to call processSync

See https://github.com/unifiedjs/unified?tab=readme…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Ahmedsaed
Comment options

Answer selected by Ahmedsaed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants