Default code editor surreptitiously remove closing (backslash) of img tag
See original GitHub issueDescription of your Issue or Request:
If i load an html (as text) inside the textarea that will become summernote editor, the present img tag is surreptitiously changed as soon as summernote load.
All the closing (backslash) in the img tag will be silently removed :
<img id="testSamle" src="..." />
will become <img id="testSamle" src="...">
steps to reproduce (Add more if necessary):
Create a minimal page with only one textarea, summernote lite (min.js and css) and jquery reference.
In text area place a text that represent the html of a tag img like the following text :
<img id="testSamle" src="..." />
Load summernote over the textarea with no configuration like :
$('#textareaId').summernote();
Now check the code edior provided in the loaded summernote control (the button with caption equal to ‘<>’) and you will see that the html shown is like the one you provide, unless for a missing tag close, in fact html into code editor will appear as follow :
<img id="testSamle" src="..." >
The final slash is missing.
What is your Operating System, Browser and Version and Summernote Version you are using:
This can help find and resolve any issues, place an x inside the brackets or if relevant elaborate after each choice.
-
Operating System: [ ] Microsoft Windows 10
-
Browser and Version: [ ] Chrome (101.0.4951.54)
-
Summernote Version, place an x inside the brackets: [ ] Lite (8.20 form here https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.20/summernote-lite.min.js)
screenshot of issue
Here the minimal example with only summernote lite and jquery (no external code) and only loading script (with no configuration) : https://jsfiddle.net/kwg6obe4/1/
Issue Analytics
- State:
- Created a year ago
- Comments:11 (4 by maintainers)
Top GitHub Comments
I recommend this article: Doctypes and markup styles
It is not a Summernote issue but a browser behavior like I indicated with the debugger editing. For this reason, every other editor gives you the same result. Examples: CKEditor tiny