Opened 11 years ago
Last modified 11 years ago
#11544 closed Bug
Wrong escaping in title tag, moving tags out of head with placeholders — at Initial Version
Reported by: | Marcus Bointon | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 4.3.4 |
Component: | UI : Widgets | Version: | 4.3 |
Keywords: | Cc: |
Description
This is related to #11223 and this forum post
I'm using the placeholder plugin in CKEditor 4.3.2, which generally works apart from two issues:
- It doesn't allow it to be used in the root of the head tag (so for example you can't use placeholders to generate meta tags); placeholder get moved into the body tag.
- Placeholder items in the title tag (and possibly elsewhere) get escaped incorrectly, and then fail to be unescaped on save, or when switching to/from source mode.
For example, starting by pasting this document into the source view:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <title>[[mytag1]]</title> [[mytag2]] </head> <body>[[mytag3]]</body> </html>
Switching to HTML view then back to source results in:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <title><span tabindex="-1" contenteditable="false" data-cke-widget-wrapper="1" data-cke-filter="off" class="cke_widget_wrapper cke_widget_new cke_widget_inline" data-cke-display-name="placeholder"><span class="cke_placeholder" data-cke-widget-keep-attr="0" data-widget="placeholder">[[mytag1]]</span></span></title> </head> <body>[[mytag2]][[mytag3]]</body> </html>
You can see an escaping wrapper has been applied in the title tag, and the [[mytag]]
element in the head tag has been moved into the body.
Doing the same switch again results in:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <title><span tabindex="-1" contenteditable="false" data-cke-widget-wrapper="1" data-cke-filter="off" class="cke_widget_wrapper cke_widget_new cke_widget_inline" data-cke-display-name="placeholder"><span class="cke_placeholder" data-cke-widget-keep-attr="0" data-widget="placeholder"><span tabindex="-1" contenteditable="false" data-cke-widget-wrapper="1" data-cke-filter="off" class="cke_widget_wrapper cke_widget_new cke_widget_inline" data-cke-display-name="placeholder"><span class="cke_placeholder" data-cke-widget-keep-attr="0" data-widget="placeholder">[[mytag1]]</span></span></span></span></title> </head> <body>[[mytag2]][[mytag3]]</body> </html>
It's now double-escaped, and this repeats each time you switch views or save.
For me this is a complete showstopper; I can't use CKEditor if it causes content explosions.