Opened 14 years ago
Closed 13 years ago
#5961 closed Bug (fixed)
Link text not updated when url changes
Reported by: | Mikko Kinnunen | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | 3.3.1 |
Keywords: | Gecko | Cc: |
Description
I'm not sure if I should open a new bug for this or simply reopen #4612 - I'm filing a new bug so admins can make that call. Feel free to close this and reopen 4612
CKEditor link plugin has feature where upon changing a link's URL, it checks to see if the old link text was equal to the old link href. If the two are (were) equal, the link text is also changed to reflect the new URL. The idea being that you don't end up with confusing links like <a href='http://google.com/'>http://yahoo.com/</a>
This feature does not work on firefox 3.6.x if the link in question is the last piece of text in its paragraph.
I tracked the problem to /plugins/link/dialog/link.js onOk function, where the old link text is read with "textView = element.getHtml();". On firefox the string returned by element.getHtml() includes an extra trailing '<br>', causing the comparinson to result in false.
The easiest fix would be to change element.getHtml() to element.getHtml().replace("<br>", ""), but you probably want do something to getHtml instead as the extra linebreaks are likely to cause other problems as well.
This bug is likely related to #5293 which also is about firefox adding extra linebreaks.
Change History (3)
comment:1 Changed 14 years ago by
Keywords: | Gecko Pending added; firefox removed |
---|
comment:2 Changed 14 years ago by
Yes it also happens on the nightly. I made brief video of it so you can see exactly the steps i've taken. Browser in the test was Firefox 3.6.6, running in safe mode to rule out interference from addons. http://koti.mbnet.fi/kinnunen/cklink/
The extra <br> is added to the link text (not href), and of course causes the comparison to return false as "http://yahoo.com" != "http://yahoo.com<br>"
comment:3 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | pending → closed |
Not able to reproduce anymore either on Firefox 12 or Firefox 3.6. Marking as fixed.
I cannot reproduce this issue on FF 3.6.6 using current trunk. The anchor innerHTML is changed according to HREF attribute. I also don't see a reason why tailing <br> would break this feature (is this BR inside the anchor ?).
We need more information on this, like some source code, mine looked like this:
Can you confirm this issue on our nighty build ?