Ticket #26 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

Patch for removing nested tags in mozilla

Reported by: bermi Owned by: jf.hovinne
Priority: major Milestone: 0.3.1
Component: editor Version: trunk
Keywords: xhtml Cc:

Description

This patch came up when trying to fix issue #22.

I found that Mozilla designMode does insert tags even if they are repeated. This leads to situations where generated code looks like this (emphasis can not be removed on wysiwm mode)

<p>Welcome to <em><em>MetaDesign</em>.</em></p>

when it should be just

<p>Welcome to <em>MetaDesign.</em></p>

As you can see it takes the outermost tag.

This might also needed on other browsers and it can be easily moved to jquery.wymeditor.js

Attachments

simplyfy_and_unnest_xhtml_tags.patch Download (2.4 KB) - added by bermi 5 years ago.
mozilla_designMode_tag_conflicts_and_tidy_xhtml.patch Download (4.4 KB) - added by bermi 5 years ago.

Change History

Changed 5 years ago by bermi

comment:1 Changed 5 years ago by bermi

Please use new patch which also fixes issue #22

comment:2 follow-up: ↓ 3 Changed 5 years ago by Moxide

Works great, but it seems to break the "display HTML" feature. When clicking on "HTML", the following JS error occurs :

e.toggle is not function

It is located in WymClassMozilla.prototype.toggleHtml.

comment:3 in reply to: ↑ 2 Changed 5 years ago by bermi

Replying to Moxide:

Works great, but it seems to break the "display HTML" feature. When clicking on "HTML", the following JS error occurs :

e.toggle is not function

It is located in WymClassMozilla.prototype.toggleHtml.

I'm using it together with prototype.js so I missed to enclose "e" in "$j()"

changing the line 285 to

    $j(e).toggle();

will fix the issue.

Changed 5 years ago by bermi

comment:4 Changed 5 years ago by jf.hovinne

  • Status changed from new to assigned

Great patch, bermi :)

Could you please add code comments in the nestedCheck/openTags part, so I'm sure I understand it well?
Thanks :)

Note: r265 removed the mouseout. See my comment at #22.

comment:5 Changed 5 years ago by bermi

See attachment in #32 for commented nestedCheck implementation.

comment:6 Changed 5 years ago by jf.hovinne

  • Milestone changed from 0.3 to 0.3.1

OK, thanks. Will be included in 0.3.1, so we can release 0.3 asap.

comment:7 Changed 5 years ago by bermi

This patch functionality is included in the  New Parser in a more elegant way, so this patch is no longer necessary.

comment:8 Changed 5 years ago by jf.hovinne

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

Fixed by the new parser.

Note: See TracTickets for help on using tickets.