Skip to content

Why my serializeHtml result is pure text,no any html tag? #2451

Closed Answered by 12joan
mazhan465 asked this question in Q&A
Discussion options

You must be logged in to vote

It's quite difficult to tell what's going on here without more context.

Since you're calling filter on value, it's clear that value is an array, presumably of Slate nodes. I don't know why you're filtering on presence of keys, though, since I've never seen an empty object in a Slate value before.

From the output you're getting, it looks to me like your value array contains a single text fragment (about a new medicine to treat stomache disorders, if I'm reading it correctly?) containing no inline or block formatting. I'm not sure why the JSON for this text fragment is being rendered from serializeHtml, unless the JSON was part of the original text.

If you want serializeHtml to output HTML …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by zbeyens
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
bug Something isn't working
3 participants
Converted from issue

This discussion was converted from issue #2367 on June 28, 2023 08:00.