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. <
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
Status: | new → confirmed |
---|
comment:2 Changed 11 years ago by
Owner: | set to Piotrek Koszuliński |
---|---|
Status: | confirmed → assigned |
comment:3 Changed 11 years ago by
comment:4 Changed 11 years ago by
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 <b>
), we should avoid changing data.
comment:5 Changed 11 years ago by
Status: | assigned → review |
---|
Pushed branch:t/11926 on dev and tests.
comment:7 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | review_passed → closed |
Fixed on master with git:d973681 on dev and d973681 on tests.
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.