#8389 closed Bug (invalid)
Editor expands <object /> to <object></object> and encloses trailing text
Reported by: | frimicc | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Core : Parser | Version: | 3.6.2 |
Keywords: | Cc: |
Description
When the following is pasted into the nightly demo CKEditor's Source view: <p><a class="subscriptions-link" href="/subscriptions/"><object data="urn:dynamic-text:journal-attribute:name" type="application/x-highwire-ui" />Subscriber Help & Information:</a></p>
if you go to WYSIWYG view and then back to Source, it's been transformed into: <p>
<a class="subscriptions-link" href="/subscriptions/"><object data="urn:dynamic-text:journal-attribute:name" type="application/x-highwire-ui">Subscriber Help & Information:</object></a></p>
which is problematic, because the new </object> tag the editor created has gobbled up the text that used to be beside it. The same problem occurs if you load into the editor a file which has the problematic <object /> tag in it already.
I've confirmed this on OS X in both Chrome 14.0.835.162 and Firefox 6.0.2 using http://nightly.ckeditor.com/7288/_samples/replacebyclass.html .
Change History (2)
comment:1 Changed 13 years ago by
Component: | General → Core : Parser |
---|---|
Resolution: | → invalid |
Status: | new → closed |
comment:2 Changed 13 years ago by
I didn't define this syntax, but knowing that <object /> is invalid HTML will let me try to talk the people who came up with the idea into changing it. In the meantime, I'll use protectedSource. Thanks for the help!
The fact is that the
<object>
element is not self-closing and requires the closing</object>
pair. I'm not the one saying so, but the W3C itself (see the object element definition).This leads to the problem, because the browsers (not the editor), see
<object />
as an opening tag with no closing pair, putting everything after it into it.You can try it yourself. Just create a page like this:
You'll see that you'll have the same output you'll have from the editor.
So, the possible solutions here:
<object />
, making it right:<object></object>
.<object />
.