Open miestr opened 4 years ago
Update: the value is broken on initialisation of the JoditEditor component. The following line of JoditEditor.js:267 sets the value:
textArea.current.value = value;
The value provided still contains the html tag, but the textArea.current.value not any more
When switching to source mode (the first time), the value of the editor is changed:
Whereas the first issue is a disaster, because html wrapper contains information relevant for backend. The second issues is also nasty, but is fixable.
How to reproduce: init JoditEditor with value f.e.
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"><head><style>body{font-family:"Verlag Office",Verdana,Sans-serif; font-size: 14px;}</style></head> <body> <h2>hello</h2>/body></html>
Switch to source mode, console.log the value of the editor. Result: tag is removed.