Opened 11 years ago

Closed 11 years ago

#11926 closed Bug (fixed)

Codesnippet does not decode HTML entities when loading source code to widget data

Reported by: Piotrek Koszuliński Owned by: Piotrek Koszuliński
Priority: Normal Milestone: CKEditor 4.4.1
Component: General Version: 4.4.1
Keywords: Cc:

Description

#11811 revealed a problem in code snippet plugin.

When, during upcast, code is read from the <code> element and set in data.code it is not decoded, so data.code contains e.g. &lt; when user should see <. We need to decode the source code, so data.code contains always the exact content which user entered in code snippet dialog.

Change History (7)

comment:1 Changed 11 years ago by Piotrek Koszuliński

Status: newconfirmed

comment:2 Changed 11 years ago by Piotrek Koszuliński

Owner: set to Piotrek Koszuliński
Status: confirmedassigned

comment:3 Changed 11 years ago by Piotrek Koszuliński

I pushed branch:t/11926 with a proposed solution. No test branch, because existing tests verify that the patch works, because they are failing on #11811.

I'm not putting this ticket on review yet, so we finalize #11811 first.

comment:4 Changed 11 years ago by Piotrek Koszuliński

When I ran tests on IE8 I turned out that there's one more bug in code snippet which we have to fix now. Code snippet will try to upcast this:

<pre><code>foo<b>x</b></code></pre>

What should not be upcasted, because in such case we'd encode the <b> element, so data will be changed. Since we cannot tell what was user's intention - emphasizing fragment of a code snippet or whether the element should be encoded to (i.e. changed to &lt;b&gt;), we should avoid changing data.

comment:5 Changed 11 years ago by Piotrek Koszuliński

Status: assignedreview

Pushed branch:t/11926 on dev and tests.

comment:6 Changed 11 years ago by Marek Lewandowski

Status: reviewreview_passed

R+

comment:7 Changed 11 years ago by Piotrek Koszuliński

Resolution: fixed
Status: review_passedclosed

Fixed on master with git:d973681 on dev and d973681 on tests.

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