Opened 6 years ago

Closed 6 years ago

Last modified 6 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: Marty2081 Owned by: alfonsoml
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 alfonsoml 6 years ago.
Proposed patch

Download all attachments as: .zip

Change History (6)

comment:1 Changed 6 years ago by Marty2081

  • Version changed from 3.4.3 (SVN - trunk) to 3.4.2

Changed 6 years ago by alfonsoml

Proposed patch

comment:2 Changed 6 years ago by alfonsoml

  • Owner set to alfonsoml
  • Status changed from new to review

comment:3 Changed 6 years ago by garry.yao

Nice catch, you can commit this as micro change.

comment:4 Changed 6 years ago by alfonsoml

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

Fixed with [6119]

comment:5 Changed 6 years ago by alfonsoml

  • Milestone set to CKEditor 3.4.3
Note: See TracTickets for help on using tickets.
© 2003 – 2016 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy