Modify

Opened 4 years ago

Closed 4 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: jun66j5
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@… 4 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@… 4 years ago.
patch to make even IE8 work

Download all attachments as: .zip

Change History (9)

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

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

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

patch to make even IE8 work

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

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

comment:5 Changed 4 years ago by 3DH

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

comment:6 Changed 4 years ago by jun66j5

(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 4 years ago by jun66j5

  • Resolution set to fixed
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Action
as closed The owner will remain jun66j5.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.