question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Default code editor surreptitiously remove closing (backslash) of img tag

See original GitHub issue

Description 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.

  1. Operating System: [ ] Microsoft Windows 10

  2. Browser and Version: [ ] Chrome (101.0.4951.54)

  3. 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:closed
  • Created a year ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
1der1commented, May 17, 2022

I recommend this article: Doctypes and markup styles

1reaction
1der1commented, May 17, 2022

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to remove the end slash from the img tag?
I would like to know if there is a way to remove the end slash from the img tag. One way until a...
Read more >
ckeditor removes trailing slash from img tag and adds ...
ckeditor removes trailing slash from img tag and adds additional attribute data-cke-saved-src. I am copy pasting the image from clipboard.
Read more >
CS110: All Readings - Computer Science - Wellesley College
The browser is an interpreter for HTML code; it reads the HTML code and renders its elements based on rules for each kind...
Read more >
Chapter 2: Filling in the index page
Starting in Chapter 3, we'll add two more pages to go along with our index page, introducing several more important HTML tags along...
Read more >
TeXShop
Marco Santi wanted a preference to set the font and size of text in the Macro Editor. There is already a preference to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found