samclarke / SCEditor

A lightweight HTML and BBCode WYSIWYG editor
http://www.sceditor.com/
Other
661 stars 187 forks source link

Bug - Firefox only: Insert a Link (Hyperlink) doesn't stop editing of the link it self #644

Open mnp-mid opened 6 years ago

mnp-mid commented 6 years ago

Insert a Link (Hyperlink) doesn't stop editing of the link it self Firefox only. (Tested with version: 58.0)

  1. Remove the content of the editor
  2. Type in some text like "abc"
  3. Click on 'Insert a link' and type in some text like "http://example.com", leave description empty
  4. Click on "Insert" to insert the link
  5. DON'T CLICK ANYWHERE ELSE
  6. Just continue typing with the text "def".

=> Result: abc[url=http://example.com]http://example.comdef[/url]

=> Expected result: abc[url=http://example.com]http://example.com[/url]def

Works perfectly in chrome!

chrisbetson commented 6 years ago

find in sceditor.min.js t.wysiwygEditorInsertHtml(\'\'+n+"\\") and add \  to the end of the link after the \

t.wysiwygEditorInsertHtml(\'\'+n+"\ \  \") cures the problem