Link attribute on images is stripped when MW pages are edited
Scott reports the following bug while editing pages on our wiki for the CUNYDHI initiative:
I put in the “Hello” image on each page of the DHI project but noticed something strange, I think caused by the FCKEditor.
My code is: [[Image:dhiMenu.jpg|right|link=The_CUNY_Digital_Humanities_Resource_Guide]] which works fine. User can click on the image and is taken to the main menu. However, when the page is edited, the link gets stripped out to this: [[Image:dhiMenu.jpg|right]] I might be wrong to blame the editor, but you can almost see it on the screen, although it happens really quickly.
I just tried editing a page and didn't run into this problem, but i have FCK editor turned off, which corroborates Scott's suspicion that this has something to do with the FCK Editor. What are your thoughts on this? I'd tell Scott to turn off FCK, but we can't really ask users to do that.
#4 Updated by Boone Gorges about 11 years ago
- Target version set to 1.0.3
I was able to reproduce the following: when entering
and saving, then returning to the edit screen, tag has been reduced to
(minus the space in the first two brackets, which is needed to keep redmine from rendering it)
Does that jibe with what you're seeing?
#5 Updated by Boone Gorges about 11 years ago
- Target version changed from 1.0.3 to Future release
I messed with this for a while (including #337, which upgrades FCKeditor) and it looks like FCKeditor just doesn't support the link attribute on Image tags. I combed through to see how hard it would be to add it, and it looks like it's going to be pretty complicated.
My thought is that any user savvy enough to make an image into a link (something unavailable in the visual editor) will be savvy enough to use WikiText markup for this kind of purpose. In other words, it's only a big problem in a relative edge case. For that reason I'd like to bump this to Future Release, hope either that future upgrades to MW/FCKeditor fix the problem or that I get time after the next big release to tear apart the extension and patch it myself.
#6 Updated by Matt Gold about 11 years ago
I agree with your assessment, but I do want to note that I don't think there is an easy way for members to go back and forth on the wiki from the WYSIWYG to the plain-text editor. That setting used to be available by viewing one's profile settings for MediaWikil, but we removed it because it was potentially confusing for people to see separate account settings for the wiki, in addition to their WP/BP profiles.
If I remember correctly, there is a "Disable Rich Text Editor" link underneath the WYSIWYG editor, but once it is removed, there is no easy way to turn it back on. Cause, perhaps, for a separate ticket.