Opened 3 years ago

Closed 3 years ago

#11926 closed Bug (fixed)

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

Reported by: Reinmar Owned by: Reinmar
Priority: Normal Milestone: CKEditor 4.4.1
Component: General Version: 4.4.1
Keywords: Cc:


#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 3 years ago by Reinmar

  • Status changed from new to confirmed

comment:2 Changed 3 years ago by Reinmar

  • Owner set to Reinmar
  • Status changed from confirmed to assigned

comment:3 Changed 3 years ago by Reinmar

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 3 years ago by Reinmar

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:


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 3 years ago by Reinmar

  • Status changed from assigned to review

Pushed branch:t/11926 on dev and tests.

comment:6 Changed 3 years ago by m.lewandowski

  • Status changed from review to review_passed


comment:7 Changed 3 years ago by Reinmar

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

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

Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy