Lexical - override default behaviour of inserting a <br> tag in node?

22 Views Asked by At

By default, any new node (paragraph, heading etc) contains a
tag until anything is written into it. Is there a way to disable this behaviour e.g. when creating a custom node?

Working on a ImageGalleryNode where I need a specific dom structure without anything else in it; E.g:

<p class='EditorTheme__galleryBlock'>
  <div class='grid-container'>
    [...]
  </div>
</p>

So far I was working around the break tag, but there is an edge case where it could cause issues, so I'd like to not create it in the first place.

0

There are 0 best solutions below