taqueci / redmine_wysiwyg_editor

Redmine WYSIWYG Editor plugin
GNU General Public License v2.0
116 stars 28 forks source link

Edits disappear when using HTML Anchors #86

Closed nanego closed 4 years ago

nanego commented 4 years ago

When we use anchors in issues or wikis, edits written in Visual Mode are not taken in account when we switch to the Textile tab. These edits disappear and a JS error appears in our browser console.

Here is the error:

href: "#2"
m: null
TypeError: m is null     redmine_wysiwyg_editor.js:893:18

And the steps to reproduce:

  1. Open new issue form
  2. In Textile mode, enter this text in description field: [[#2]]
  3. Switch to Visual tab
  4. Select the '#2' link
  5. Click on the icon to "edit link"
  6. "Insert link" form appears. Click OK without modifying anything
  7. Switch back to textile tab ⇒ the error appears in the console

Thank you for your help!

taqueci commented 4 years ago

Hi @nanego

Thank you for reporting the issue.

I have fixed error caused by a link to an anchor on the same page.
Could you please try branch issue/86?

nanego commented 4 years ago

Thank you @taqueci. The fix works very well.

taqueci commented 4 years ago

Hi @nanego

Thank you for confirming.
The commit has been merged into master branch.