Modify

Opened 14 years ago

Closed 14 years ago

#7716 closed enhancement (fixed)

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

Reported by: anonymous Owned by: Jun Omae
Priority: normal Component: TracWysiwygPlugin
Severity: normal Keywords: Firefox
Cc: Trac Release: 0.11

Description

When adding a CamelCase in wysiwyg mode, a link like

  <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 ;-)

Attachments (2)

wysiwyg.js.diff (3.2 KB) - added by helmut.buchsbaum@… 14 years ago.
Patch against wysiwyg.js of [8691] to avoid custom element attributes
wysiwyg.js.IEok.diff.bz2 (1.2 KB) - added by helmut.buchsbaum@… 14 years ago.
patch to make even IE8 work

Download all attachments as: .zip

Change History (9)

comment:1 Changed 14 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 14 years ago by helmut.buchsbaum@…

Attachment: wysiwyg.js.diff added

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

comment:2 in reply to:  1 ; Changed 14 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 ; Changed 14 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 14 years ago by helmut.buchsbaum@…

Attachment: wysiwyg.js.IEok.diff.bz2 added

patch to make even IE8 work

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

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

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

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

comment:6 Changed 14 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 14 years ago by Jun Omae

Resolution: fixed
Status: newclosed

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.