Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#11672 closed Bug (duplicate)

EJS templates not preserved by protectedsource

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

Description

I am using CKEditor 4.3.3 (revision 7841b02) (currently the latest revision) on my web app. I have used the protecedsource to escape EJS templates (<%= ... %>), and here is a copy of the regEx used:

protectedSource: [/<%[\s\S]*?%>/g, /&nbsp;/g]

The problem appears when switching between source and wysiwyg editor. When the html code in source editor is in this format:

<div style="color: #aaaaaa;">
  <a href="<%= link(1) %>">Test link</a>
</div>

it all works normally. However, when html is in this format:

<div style="color: 
  #aaaaaa;"><a href="<%= link(1) %>">Test link</a>
</div>

after switching to wysiwyg and back to source, it changes to this:

<div style="color: 
  #aaaaaa;">
<a href="&lt;!--{cke_protected}%3C%25%3D%20link(1)%20%25%3E--&gt;">Test link</a>
</div>

This way all html made with EJS templates becomes broken. I am including screenshots of the issue. Is there any way that this problem could be solved?

Attachments (2)

EJS protectedsource 2.jpg (125.3 KB) - added by Goran 6 years ago.
EJS protectedsource 1.jpg (110.0 KB) - added by Goran 6 years ago.

Download all attachments as: .zip

Change History (4)

Changed 6 years ago by Goran

Attachment: EJS protectedsource 2.jpg added

Changed 6 years ago by Goran

Attachment: EJS protectedsource 1.jpg added

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

Keywords: EJS template protectedsource removed
Resolution: duplicate
Status: newclosed
Version: 4.3.3

I'm happy to say that this issue was already fixed in #9205 which will be released in CKEditor 4.3.4 on 25th of March.

comment:2 Changed 6 years ago by Goran

Great, thanks! :)

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