Opened 8 years ago

Closed 8 years ago

#16711 closed Bug (invalid)

Ckeditor changes attribute (and creates new attribute) when an attribute contains " ... occurs on load

Reported by: Fred Lovine Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

Steps to reproduce

  1. Load the following html in ckeditor: <p><img alt="abc &quot;xyz" /></p>
  2. View in source mode

Here is a test page: <!doctype html> <html lang="en"> <head>

<script type="text/javascript" src="/ckeditor/ckeditor.js"></script> <script type="text/javascript" language="javascript">

window.onload = function() {

CKEDITOR.config.allowedContent = true; CKEDITOR.replace( 'contentId', { });

};

</script>

</head> <body>

<textarea name="content" id="contentId"><p><img alt="abc &quot;xyz" /></p>

</body> </html>

Expected result

<p><img alt="abc &quot;xyz" /></p>

Actual result

<p><img alt="abc " xyz="" /></p>

Other details (browser, OS, CKEditor version, installed plugins)

Tested in Chrome and Edge. Occurs in version 4.5.9 and 4.6.0.

Change History (2)

comment:1 Changed 8 years ago by Fred Lovine

Oops, forgot </textarea> ... use this test page:

<!doctype html> <html lang="en"> <head>

<script type="text/javascript" src="/ckeditor/ckeditor.js"></script> <script type="text/javascript" language="javascript">

window.onload = function() {

CKEDITOR.config.allowedContent = true; CKEDITOR.replace( 'contentId', { });

};

</script>

</head> <body>

<textarea name="content" id="contentId"><p><img alt="abc &quot;xyz" src="/x" /></p></textarea>

</body> </html>

comment:2 Changed 8 years ago by Jakub Ś

Resolution: invalid
Status: newclosed
Version: 4.6.0

Please try creating image through image dialog and entering alt text there. The abc &quot;xyz will be converted to abc &amp;quot;xyz.

Please have a look at e.g. ckeditor/samples/old/replacebycode.html. This sample just like any other has initial HTML ecnoded. It is obvious that if you were to insert such content yourself you would encode the &quot; as well so that it is rendered as " and not treated as closing quote for alt attribute. You would want to have &quot; text &amp;quot; text &quot; instead of &quot; text &quot; text &quot;

I'm sorry but I can't accept this ticket as you should rather encode your HTML before inserting it into editor.

Please also see: #10352 and #8927

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