[FEATURE] RTE: Keep HTML5 block tags when clean pasting text
authorStanislas Rolland <typo3@sjbr.ca>
Thu, 5 Jul 2012 15:20:23 +0000 (11:20 -0400)
committerStanislas Rolland <typo3@sjbr.ca>
Thu, 5 Jul 2012 15:22:58 +0000 (17:22 +0200)
Description: When pasting while pasteStructure or pasteFormat behaviour
is enabled, the default behaviour should keep HTML5 block tags article,
aside, footer, header, nav and section. These defaults may be modified
in Page TSConfig with buttons.pastebehaviour.[behaviour].keepTags.

Change-Id: I448b7c5e3dd73eeb037aba805406f429bb93461a
Releases: 6.0
Resolves:#38683
Reviewed-on: http://review.typo3.org/12638
Reviewed-by: Stanislas Rolland
Tested-by: Stanislas Rolland
typo3/sysext/rtehtmlarea/doc/manual.sxw
typo3/sysext/rtehtmlarea/extensions/PlainText/locallang_csh.xlf
typo3/sysext/rtehtmlarea/htmlarea/plugins/PlainText/plain-text.js

index 1f160c8..087f0ae 100644 (file)
Binary files a/typo3/sysext/rtehtmlarea/doc/manual.sxw and b/typo3/sysext/rtehtmlarea/doc/manual.sxw differ
index d83c731..ab28e35 100644 (file)
@@ -66,7 +66,7 @@ The "Clean Paste Behaviour" dialogue is activated by clicking on the "Clean Past
                        </trans-unit>
                        <trans-unit id="pasteStructure.details" xml:space="preserve">
                                <source>By default, "Structure only" means that:
-- only the following HTML elements are retained: a, p, h[0-6], pre, address, blockquote, div, hr, br, table, thead, tbody, tfoot, caption, tr, th, td, ul, ol, dl, li, dt, dd;
+- only the following HTML elements are retained: a, p, h[0-6], pre, address, article, aside, blockquote, div, footer, header, nav, section, hr, br, table, thead, tbody, tfoot, caption, tr, th, td, ul, ol, dl, li, dt, dd;
 - the following HTML attributes are removed: id, style, class, lang, align, valign, bgcolor, color, border, face, any attribute starting with "on", and any attribute containing ":".
 
 These defaults may be modified in Page TSConfig.</source>
@@ -83,7 +83,7 @@ These defaults may be modified in Page TSConfig.</source>
                        </trans-unit>
                        <trans-unit id="pasteFormat.details" xml:space="preserve">
                                <source>By default, "Structure and basic format" means that:
-- the following HTML structural elements are retained: a, p, h[0-6], pre, address, blockquote, div, hr, br, table, thead, tbody, tfoot, caption, tr, th, td, ul, ol, dl, li, dt, dd;
+- the following HTML structural elements are retained: a, p, h[0-6], pre, address, article, aside, blockquote, div, footer, header, nav, section, hr, br, table, thead, tbody, tfoot, caption, tr, th, td, ul, ol, dl, li, dt, dd;
 - the following HTML inline elements are also retained: b, bdo, big, cite, code, del, dfn, em, i, ins, kbd, label, q, samp, small, strike, strong, sub, sup, tt, u, var;
 - the following HTML attributes are removed: id, style, class, lang, align, valign, bgcolor, color, border, face, any attribute starting with "on", and any attribute containing ":".
 
index bee14f2..f6b1bbe 100644 (file)
@@ -79,11 +79,11 @@ HTMLArea.PlainText = Ext.extend(HTMLArea.Plugin, {
         */
        cleanerConfig: {
                pasteStructure: {
-                       keepTags: /^(a|p|h[0-6]|pre|address|blockquote|div|hr|br|table|thead|tbody|tfoot|caption|tr|th|td|ul|ol|dl|li|dt|dd)$/i,
+                       keepTags: /^(a|p|h[0-6]|pre|address|article|aside|blockquote|div|footer|header|nav|section|hr|br|table|thead|tbody|tfoot|caption|tr|th|td|ul|ol|dl|li|dt|dd)$/i,
                        removeAttributes: /^(id|on*|style|class|className|lang|align|valign|bgcolor|color|border|face|.*:.*)$/i
                },
                pasteFormat: {
-                       keepTags: /^(a|p|h[0-6]|pre|address|blockquote|div|hr|br|table|thead|tbody|tfoot|caption|tr|th|td|ul|ol|dl|li|dt|dd|b|bdo|big|cite|code|del|dfn|em|i|ins|kbd|label|q|samp|small|strike|strong|sub|sup|tt|u|var)$/i,
+                       keepTags: /^(a|p|h[0-6]|pre|address|article|aside|blockquote|div|footer|header|nav|section|hr|br|table|thead|tbody|tfoot|caption|tr|th|td|ul|ol|dl|li|dt|dd|b|bdo|big|cite|code|del|dfn|em|i|ins|kbd|label|q|samp|small|strike|strong|sub|sup|tt|u|var)$/i,
                        removeAttributes:  /^(id|on*|style|class|className|lang|align|valign|bgcolor|color|border|face|.*:.*)$/i
                }
        },