﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
11544	Placeholders should not be upcasted in parents not accepting spans	Marcus Bointon	Marek Lewandowski	"== New description ==

1. Download and open [[attachment:11544.html]].
2. Switch between modes.
3. See that there's a mess in `<title>` tag.

Important note: While working on this issue other scenarios like placeholder used in <textarea> or <video> should be checked. Perhaps more parent tags should be excluded. The rule may be that placeholder may only be created in if, according to DTD, text node's parent accepts span.

== Original description (incorrect) ==

This is related to #11223 and [http://ckeditor.com/forums/Support/Ignoring-placeholders-protectedSource-not-working-in-title-element 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>&lt;span tabindex=&quot;-1&quot; contenteditable=&quot;false&quot; data-cke-widget-wrapper=&quot;1&quot; data-cke-filter=&quot;off&quot; class=&quot;cke_widget_wrapper cke_widget_new cke_widget_inline&quot; data-cke-display-name=&quot;placeholder&quot;&gt;&lt;span class=&quot;cke_placeholder&quot; data-cke-widget-keep-attr=&quot;0&quot; data-widget=&quot;placeholder&quot;&gt;[[mytag1]]&lt;/span&gt;&lt;/span&gt;</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>&lt;span tabindex=&quot;-1&quot; contenteditable=&quot;false&quot; data-cke-widget-wrapper=&quot;1&quot; data-cke-filter=&quot;off&quot; class=&quot;cke_widget_wrapper cke_widget_new cke_widget_inline&quot; data-cke-display-name=&quot;placeholder&quot;&gt;&lt;span class=&quot;cke_placeholder&quot; data-cke-widget-keep-attr=&quot;0&quot; data-widget=&quot;placeholder&quot;&gt;&lt;span tabindex=&quot;-1&quot; contenteditable=&quot;false&quot; data-cke-widget-wrapper=&quot;1&quot; data-cke-filter=&quot;off&quot; class=&quot;cke_widget_wrapper cke_widget_new cke_widget_inline&quot; data-cke-display-name=&quot;placeholder&quot;&gt;&lt;span class=&quot;cke_placeholder&quot; data-cke-widget-keep-attr=&quot;0&quot; data-widget=&quot;placeholder&quot;&gt;[[mytag1]]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;</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."	Bug	closed	Normal	CKEditor 4.3.4	UI : Widgets	4.3	fixed		
