Opened 7 years ago

Closed 7 years ago

CamelCase links are not correctly created when using Firefox 3.6.9 or above

Reported by: Owned by: anonymous Jun Omae normal TracWysiwygPlugin normal Firefox 0.11

Description

  <trac location>/wiki/CamelCase


should be created. Instead, when using FF 3.6.9 or above a link like

  http://myserver/mytrac/search/opensearch?q=wiki%3ACamelCase


shows up, which obviously does not work. I tracked this down to the use of insertHTML() in wysiwyg.js, which, since FF 3.6.9 drops all custom HTML tags, in this case e.g. tracwysiwyg-autolink. This problem has already been filed at Mozilla as Bug 596300 - Element Attributes dropped in DesignMode/ContentEditable sections. We use Trac 0.11.7 with TracWysiwygPlugin 0.11.0.2 (r8691). Since we always try to keep up with Mozillas update for security reasons, I wonder if there is any workaround for the changed behavior of FF.

Remark: as I understand from the discussion at Bug 596300 the use of data-* custom attributes is recommended, but only supported in FF 4.0b7. So probably at least a change to e.g. data-tracwysiwyg-autolink could prepare TracWysiwyg for an upgraded version of FF ;-)

comment:1 follow-up:  2 Changed 7 years ago by helmut.buchsbaum@…

I've just implemented a workaround which avoids the use of custom attributes by wrapping all anchors in a span element and moving the data in hidden input fields also within this span element. This requires changes only in createAnchor() and pushAnchor() of wysiwyg.js. The attached patch applies against [8691], the 0.11 branch.

I've only tested it using Trac 0.11.7 using Firefox 3.6.10 (Windows & Linux).

Since my Javascript and HTML knowledge is limited I may have overlooked other issues, so please verify its correctness!

Changed 7 years ago by helmut.buchsbaum@…

Patch against wysiwyg.js of [8691] to avoid custom element attributes

comment:2 in reply to:  1 ; follow-up:  3 Changed 7 years ago by helmut.buchsbaum@…

Oops, I'm sorry I haven't tested my patch with M\$-IE due to debugging on Linux!

IE does not like my type="hidden" attribute, but the new attributes in the hidden input tags make even IE8 happy ;-)

Use wysiwyg.js.IEok.diff for patching wysiwyg.js of revision [8691]!

comment:3 in reply to:  2 ; follow-up:  4 Changed 7 years ago by anonymous

Unfortunately I cannot attach my patch since the server rejects it:

500 Internal Server Error (Submission rejected as potential spam (Content contained these blacklisted patterns: '(?i)display:\s*none'))


This is just what does the trick!

Changed 7 years ago by helmut.buchsbaum@…

patch to make even IE8 work

comment:4 in reply to:  3 Changed 7 years ago by helmut.buchsbaum@…

So just zipping the "dangerous" file is obviously enough to be able to upload it!

comment:5 Changed 7 years ago by 3dh@…

Great work! It works flawlessly - I would appreciate seeing it merged into the official trunk/branches.

comment:6 Changed 7 years ago by Jun Omae

(In [9387]) refs #7716

• Fixed the problem with Firefox 3.6.9
• Uses data-* custom attributes and stores attibutes in #hash href

comment:7 Changed 7 years ago by Jun Omae

Resolution: → fixed new → closed

I fixed the issue in [9387]. If you can reproduce, please reopen the issue. Thanks for your reporting.

Modify Ticket

Change Properties