#8117 closed New Feature (fixed)
HTML 5 Support / meta element in body
Reported by: | Russ Tennant | Owned by: | Marek Lewandowski |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 4.4.3 |
Component: | General | Version: | 3.0 |
Keywords: | HTML5 | Cc: | micky@… |
Description
It would be nice to be able to enter meta tags like "<meta content=5 itemprop=bestRating />" in the source code view without side effects. Currently it adds empty paragraphs. Example markup: http://schema.org/Event
This happens in google chrome.
Change History (22)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
Sorry but meta tags are only allowed in head section (HTML4 and HTML5) - http://www.w3schools.com/html5/tag_meta.asp
You have used invalid HTML and you have got weird result. Sorry but this will not get implemented.
comment:3 Changed 13 years ago by
It is valid HTML5 microdata to use a meta tag in the body and does validate on the W3 validator and validator.nu. Many HTML5 microdata examples exist using the meta tag in the body as microdata. For example, there are many examples on http://schema.org like http://schema.org/Rating and in the spec http://www.w3.org/TR/html5/microdata.html.
Edit: Current links for mocro data:
- http://www.w3.org/html/wg/drafts/microdata/master/
- http://www.whatwg.org/specs/web-apps/current-work/multipage/microdata.html
comment:4 Changed 13 years ago by
Also, it is worth mentioning that we do use this feature - it's a real use-case. We've patched the CKEditor to allow all meta tags in the body which is not ideal. Our users get microdata examples from Google and copy&paste or integrate them into the content they add to their sites via the CKEditor.
comment:5 Changed 13 years ago by
Resolution: | invalid |
---|---|
Status: | closed → reopened |
comment:6 Changed 13 years ago by
Keywords: | HTML5 added |
---|---|
Status: | reopened → confirmed |
Version: | 3.6.1 → 3.0 |
Sorry my bad. I have focused on the example with empty meta tag instead of microformat <meta content=5 itemprop=bestRating />
mentioned in ticket description.
This is HTML5. I’m not sure about CKEditor 3.x but this feature should and will most likely be implemented in v4 of the editor for which RC will soon be released.
Ironically this feature was supported till CKEditor 3.5.3 rev [6629]. Meta tag was ignored. Perhaps we should come back to ignoring technique? More details in #9006.
comment:9 Changed 11 years ago by
I believe this is still an issue. I'm looking to do something similar to this (from Google page about microformats):
<div itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"> Rating: <span itemprop="value">8.5</span> <meta itemprop="best" content="10" /> </div>
But it strips out the META part. I just verified on the current demo page which appears to have 4.4.1
comment:10 Changed 11 years ago by
Cc: | micky@… added |
---|---|
Version: | 3.0 → 4.4.1 |
comment:11 Changed 11 years ago by
Version: | 4.4.1 → 3.0 |
---|
Version number indicates when problem has started occurring. Please don't change it.
comment:14 Changed 10 years ago by
Milestone: | → CKEditor 4.4.3 |
---|
We'll use source protection - https://github.com/ckeditor/ckeditor-dev/blob/0c7e0e0/core/htmldataprocessor.js#L859-L866. Not a perfect solution, but definitely the easiest.
comment:15 Changed 10 years ago by
comment:16 Changed 10 years ago by
Owner: | set to Marek Lewandowski |
---|---|
Status: | confirmed → assigned |
comment:17 Changed 10 years ago by
Status: | assigned → review |
---|
Pushed to t/8117 at dev.
Note: meta
tags will be stripped by ACF by default. To preserve meta tags add following property to your config:
config.allowedContent = 'meta[itemprop,content]';
or object oriented:
config.allowedContent = { 'meta': { attributes: 'itemprop,content' } };
comment:19 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | review_passed → closed |
Fixed on master with git:afc35ce.
I'm still analysing whether we should require space after <meta
, because I'm a little bit worried that we may protect too much.
comment:20 Changed 10 years ago by
Is there any chance to backport a fix to ckeditor 3 or to have a workaround there ?
We found two different settings that work around the problem, but they are not recommended in the documentation:
Note: Changing the default value might introduce unpredictable usability issues config.autoParagraph = false;
// Not recommended. config.enterMode = CKEDITOR.ENTER_BR;
comment:21 Changed 10 years ago by
We do not backport patches to previous versions. However, you can try. This one should be pretty simple.
comment:22 Changed 10 years ago by
It's a bit strange to avoid backporting patches when maintaining a stable version, but it was indeed very easy to apply (even to the minified version) and it works perfectly, thanks a lot !
With:
See the 'bla' move down in the editor when you keep switching to code view and back :)
This problem is not browser specific.