[FEATURE] htmlArea RTE: Preserve microdata attributes
authorStanislas Rolland <typo3@sjbr.ca>
Tue, 24 Jan 2012 17:16:09 +0000 (12:16 -0500)
committerStanislas Rolland <typo3@sjbr.ca>
Tue, 24 Jan 2012 17:18:43 +0000 (18:18 +0100)
Preserve microdata attributes (itemscope, itemtype, itemprop) in RTE operations and in default configuration of RTE transformation.

Change-Id: Icb0ce5169c07e19a68db4422e5a2d6c1b0b7c862
Resolves: #33418
Releases: 4.7
Reviewed-on: http://review.typo3.org/8678
Reviewed-by: Stanislas Rolland
Tested-by: Stanislas Rolland
typo3/sysext/rtehtmlarea/doc/manual.sxw
typo3/sysext/rtehtmlarea/htmlarea/plugins/BlockElements/block-elements.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/InlineElements/inline-elements.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/TextStyle/text-style.js
typo3/sysext/rtehtmlarea/res/proc/pageTSConfig.txt

index c45ff97..606e123 100644 (file)
Binary files a/typo3/sysext/rtehtmlarea/doc/manual.sxw and b/typo3/sysext/rtehtmlarea/doc/manual.sxw differ
index 868b3eb..01f7901 100644 (file)
@@ -61,9 +61,9 @@ HTMLArea.BlockElements = Ext.extend(HTMLArea.Plugin, {
                                }
                        }
                }
-               this.allowedAttributes = new Array("id", "title", "lang", "xml:lang", "dir", "class");
+               this.allowedAttributes = new Array('id', 'title', 'lang', 'xml:lang', 'dir', 'class', 'itemscope', 'itemtype', 'itemprop');
                if (Ext.isIE) {
-                       this.addAllowedAttribute("className");
+                       this.addAllowedAttribute('className');
                }
                this.indentedList = null;
                        // Standard block formating items
index 7f3e6a3..61a5bee 100644 (file)
@@ -39,9 +39,9 @@ HTMLArea.InlineElements = Ext.extend(HTMLArea.Plugin, {
                if (this.getPluginInstance('TextStyle')) {
                        this.allowedAttributes = this.getPluginInstance('TextStyle').allowedAttributes;
                } else {
-                       this.allowedAttributes = new Array("id", "title", "lang", "xml:lang", "dir", "class");
+                       this.allowedAttributes = new Array('id', 'title', 'lang', 'xml:lang', 'dir', 'class', 'itemscope', 'itemtype', 'itemprop');
                        if (Ext.isIE) {
-                               this.addAllowedAttribute("className");
+                               this.addAllowedAttribute('className');
                        }
                }
                        // Getting tags configuration for inline elements
index 76ac092..c11d3d8 100644 (file)
@@ -74,9 +74,9 @@ HTMLArea.TextStyle = Ext.extend(HTMLArea.Plugin, {
                this.REInlineTags = /^(a|abbr|acronym|b|bdo|big|cite|code|del|dfn|em|i|img|ins|kbd|q|samp|small|span|strike|strong|sub|sup|tt|u|var)$/;
                
                        // Allowed attributes on inline elements
-               this.allowedAttributes = new Array("id", "title", "lang", "xml:lang", "dir", "class");
+               this.allowedAttributes = new Array('id', 'title', 'lang', 'xml:lang', 'dir', 'class', 'itemscope', 'itemtype', 'itemprop');
                if (Ext.isIE) {
-                       this.addAllowedAttribute("className");
+                       this.addAllowedAttribute('className');
                }
                /*
                 * Registering plugin "About" information
index 36e0735..059482c 100644 (file)
@@ -51,7 +51,7 @@ RTE.default.proc {
                ## Attributes class and align are always preserved
                ## Align attribute will be unset on entry (see below)
                ## This is a list of additional attributes to keep
-       keepPDIVattribs = id, title, dir, lang, xml:lang
+       keepPDIVattribs = id, title, dir, lang, xml:lang, itemscope, itemtype, itemprop
 
                ## REMAP BOLD AND ITALIC TO STRONG AND EMPHASIS AND VICE VERSA
        transformBoldAndItalicTags = 1
@@ -83,35 +83,37 @@ RTE.default.proc {
 
                                ## CLEAN ATTRIBUTES ON THE FOLLOWING TAGS
                        span.fixAttrib.style.unset = 1
+                       span.allowedAttribs = id, title, dir, lang, xml:lang, class, itemscope, itemtype, itemprop
+                       span.rmTagIfNoAttrib = 1
                        p {
-                               allowedAttribs = id, title, dir, lang, xml:lang, class
+                               allowedAttribs = id, title, dir, lang, xml:lang, class, itemscope, itemtype, itemprop
                                fixAttrib.align.unset = 1
                        }
                        div < .p
                        hr.allowedAttribs = class
-                       b.allowedAttribs = id, title, dir, lang, xml:lang, class
-                       bdo.allowedAttribs = id, title, dir, lang, xml:lang, class
-                       big.allowedAttribs = id, title, dir, lang, xml:lang, class
-                       blockquote.allowedAttribs = id, title, dir, lang, xml:lang, class
-                       cite.allowedAttribs = id, title, dir, lang, xml:lang, class
-                       code.allowedAttribs = id, title, dir, lang, xml:lang, class
-                       del.allowedAttribs = id, title, dir, lang, xml:lang, class
-                       dfn.allowedAttribs = id, title, dir, lang, xml:lang, class
-                       em.allowedAttribs = id, title, dir, lang, xml:lang, class
-                       i.allowedAttribs = id, title, dir, lang, xml:lang, class
-                       ins.allowedAttribs = id, title, dir, lang, xml:lang, class
-                       kbd.allowedAttribs = id, title, dir, lang, xml:lang, class
-                       label.allowedAttribs = id, title, dir, lang, xml:lang, class
-                       q.allowedAttribs = id, title, dir, lang, xml:lang, class
-                       samp.allowedAttribs = id, title, dir, lang, xml:lang, class
-                       small.allowedAttribs = id, title, dir, lang, xml:lang, class
-                       strike.allowedAttribs = id, title, dir, lang, xml:lang, class
-                       strong.allowedAttribs = id, title, dir, lang, xml:lang, class
-                       sub.allowedAttribs = id, title, dir, lang, xml:lang, class
-                       sup.allowedAttribs = id, title, dir, lang, xml:lang, class
-                       tt.allowedAttribs = id, title, dir, lang, xml:lang, class
-                       u.allowedAttribs = id, title, dir, lang, xml:lang, class
-                       var.allowedAttribs = id, title, dir, lang, xml:lang, class
+                       b.allowedAttribs < .span.allowedAttribs
+                       bdo.allowedAttribs < .span.allowedAttribs
+                       big.allowedAttribs < .span.allowedAttribs
+                       blockquote.allowedAttribs < .span.allowedAttribs
+                       cite.allowedAttribs < .span.allowedAttribs
+                       code.allowedAttribs < .span.allowedAttribs
+                       del.allowedAttribs < .span.allowedAttribs
+                       dfn.allowedAttribs < .span.allowedAttribs
+                       em.allowedAttribs < .span.allowedAttribs
+                       i.allowedAttribs < .span.allowedAttribs
+                       ins.allowedAttribs < .span.allowedAttribs
+                       kbd.allowedAttribs < .span.allowedAttribs
+                       label.allowedAttribs < .span.allowedAttribs
+                       q.allowedAttribs < .span.allowedAttribs
+                       samp.allowedAttribs < .span.allowedAttribs
+                       small.allowedAttribs < .span.allowedAttribs
+                       strike.allowedAttribs < .span.allowedAttribs
+                       strong.allowedAttribs < .span.allowedAttribs
+                       sub.allowedAttribs < .span.allowedAttribs
+                       sup.allowedAttribs < .span.allowedAttribs
+                       tt.allowedAttribs < .span.allowedAttribs
+                       u.allowedAttribs < .span.allowedAttribs
+                       var.allowedAttribs < .span.allowedAttribs
                }
 
                        ## REMOVE OPEN OFFICE META DATA TAGS, WORD 2003 TAGS, LINK, META, STYLE AND TITLE TAGS, AND DEPRECATED HTML TAGS