Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#6720 closed Bug (fixed)

CKE specific attributes _cke_saved_href and _cke_saved_src not removed from code example if preceded by <abbr> or <acronym>

Reported by: Martijn Vermeulen Owned by: Alfonso Martínez de Lizarrondo
Priority: Normal Milestone: CKEditor 3.4.3
Component: General Version: 3.4.2
Keywords: Cc:

Description

We use CKEditor as the editor in Drupal 6.x for one of our projects. One of the features of the website is showing code examples to visitors. As the website has to comply with the Web Guidelines for the Dutch government (which are based on WCAG1) the use of <abbr> elements is abundant.

This is where a problem arises:

CKEditor adds _cke_saved_href and _cke_saved_src attributes in the code examples if the code sample (which is between <pre> tags) is preceded by <abbr> or <acronym> elements.

I've downloaded CKEditor and reproduced this problem by editing one of the samples to reflect this situation.

In divreplace.html I've created this <div>:

  <div class="editable">
  <pre>&lt;a href=&quot;#&quot; onclick=&quot;window.open(&#39;http://domein.nl/pagina&#39;, &#39;_blank&#39;);&quot;&gt;</pre>
  <acronym>HTML</acronym>
  <pre>&lt;a href=&quot;#&quot; onclick=&quot;window.open(&#39;http://domein.nl/pagina&#39;, &#39;_blank&#39;);&quot;&gt;</pre>
    <abbr>HTML</abbr>
  <pre>&lt;a href=&quot;#&quot; onclick=&quot;window.open(&#39;http://domein.nl/pagina&#39;, &#39;_blank&#39;);&quot;&gt;</pre>
  <pre>&lt;a href=&quot;#&quot; onclick=&quot;window.open(&#39;http://domein.nl/pagina&#39;, &#39;_blank&#39;);&quot;&gt;</pre>
</div>

This results in the following content of the CKEditor:

<a href="#" onclick="window.open('http://domein.nl/pagina', '_blank');">
HTML

<a href="#" _cke_saved_href="#" onclick="window.open('http://domein.nl/pagina', '_blank');">
HTML

<a href="#" _cke_saved_href="#" onclick="window.open('http://domein.nl/pagina', '_blank');">
<a href="#" onclick="window.open('http://domein.nl/pagina', '_blank');">

As you can see the first line of example code is OK; no _cke_* attributes are added. The second and third line of example code get "polluted" with _cke_* attributes. The fourth line is ok again (only the first line of example code after a <abbr> or <acronym> element is affected).

The problem is with the href AND the src attributes and occurs in all browsers I've tried (IE8, FF3, Chrome7).

We've temporarely fixed the output to visitors by removing the _cke_* attributes before content is saved to the database, but we would very much like this to be fixed in the CKEditor itself.

Kind regards, Martijn

Attachments (1)

6720.patch (785 bytes) - added by Alfonso Martínez de Lizarrondo 14 years ago.
Proposed patch

Download all attachments as: .zip

Change History (6)

comment:1 Changed 14 years ago by Martijn Vermeulen

Version: 3.4.3 (SVN - trunk)3.4.2

Changed 14 years ago by Alfonso Martínez de Lizarrondo

Attachment: 6720.patch added

Proposed patch

comment:2 Changed 14 years ago by Alfonso Martínez de Lizarrondo

Owner: set to Alfonso Martínez de Lizarrondo
Status: newreview

comment:3 Changed 14 years ago by Garry Yao

Nice catch, you can commit this as micro change.

comment:4 Changed 14 years ago by Alfonso Martínez de Lizarrondo

Resolution: fixed
Status: reviewclosed

Fixed with [6119]

comment:5 Changed 14 years ago by Alfonso Martínez de Lizarrondo

Milestone: CKEditor 3.4.3
Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy