Alex-D / Trumbowyg

A lightweight and amazing WYSIWYG JavaScript editor under 10kB
https://alex-d.github.io/Trumbowyg
MIT License
4.02k stars 614 forks source link

"Cannot read property 'startContainer' of null" with b element #1233

Closed blocknotes closed 3 years ago

blocknotes commented 3 years ago

"Cannot read property 'startContainer' of null" JavaScript error with the following initial content: <p><b>Test</b></p>

Description

Using Trumbowyg 2.25.0 and setting <p><b>Test</b></p> as initial content for the editor I get the JS error "Cannot read property 'startContainer' of null" and the toolbar is not available.

How to reproduce?

https://jsfiddle.net/dLvfeaob/1/

<div id="editor">
  <p><b>Test</b></p>
</div>
$(document).ready(function() {
  $('#editor').trumbowyg();
});
Alex-D commented 3 years ago

Thank you for the report! I've fixed it in 2.25.1 :)

blocknotes commented 3 years ago

wow 🚀 thanks @Alex-D