0

I am generating HTML from Lexical using $generateHTMLfromNodes.

The HTML code I get is e.g. this one:

<p dir="ltr">
<span>Hello </span>
<s>
<i>
<em class="editor-text-strikethrough">crazy frog</em>
</i>
</s>
</p>

How can I get rid of:

  • dir="ltr"
  • class="editor-text-strikethrough

Also, why is there a span automagically inserted inside each <p></p>-tag? And why is there an <i> and an <em> when one would be sufficient?

nerdess
  • 10,051
  • 10
  • 45
  • 55

1 Answers1

0

I found a solution and described it here: https://github.com/facebook/lexical/discussions/3828#discussioncomment-5804228

nerdess
  • 10,051
  • 10
  • 45
  • 55