AlessioGr / payload-plugin-lexical

Extends payload CMS with Meta's lexical RichText editor - a much more advanced and customizable richtext editor
MIT License
149 stars 6 forks source link

Headings in editor don't do anything different than regular text #46

Closed jddunn closed 1 year ago

jddunn commented 1 year ago

Not sure if I'm somehow doing something wrong, or why this issue is happening for me.

Problem:

Changing text to any of the heading elements in the editor don't do anything.

I tried with H1, H2, H3, etc. and in the editor, they render visually as the right headings. But when I catch the data in my frontend, I print the contents of all the text nodes from Lexical. And all I get is this:

{detail: 0, format: 0, mode: 'normal', style: '', text: "The text.."}

So there's only formatting details (and this is another bug, multiple formats, see the other issue I opened), nothing that differentiates the type of heading or text to render.

Solution:

Change value of type from text to a heading level, or add that as another property returned here.

Edit: Looks like I was doing something wrong, sorry