Ticket #207 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Uneven deletion of SPAN tags with inline styles

Reported by: mr_lundis Owned by: jf.hovinne
Priority: minor Milestone: 1.0
Component: editor Version: trunk
Keywords: Cc:

Description

When we open database content such as the following,

<p>test <span style="font-weight:bold;">test</span> test</p>

and then save the content through WYMeditor, the <span> tag is replaced with an appropriate <strong> tag.

<p>test <strong>test</strong> test</p>

However, if we use content where the style attribute does not have an equivalent html tag:

<p>test <span style="text-transform:uppercase;">test</span> test</p>

the opening <span> tag is completely removed by WYMeditor, leaving an orphaned </span>.

<p>test test</span> test</p>

Obviously, this is an issue.

This happens only with <span> tags. Other tags, such as <strong> or <em> are not affected.

This is the latest WYMeditor release (0.5rc1)

Reported by mark_ndg in:
 http://forum.wymeditor.org/forum/viewtopic.php?f=2&t=716#p2441

The question is which behaviour is most appropriate? Should the closing span tag also be removed or should the span be preserved?

This issue doesn't appear in IE what I can see. Did a quick test in FF 3.6, Chrome 4 and IE 8.

Change History

comment:1 Changed 2 years ago by mr_lundis

  • Milestone changed from 0.5 to 1.0

comment:2 Changed 2 years ago by mr_lundis

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

Fixed in r672. Styled spans with no corresponding semantic element are kept as we allow inline styling elsewhere. If this is unwanted the style attribute can be removed from the valid attributes in the validator.

Note: See TracTickets for help on using tickets.