Skip to content

Instantly share code, notes, and snippets.

@toh82
Last active August 29, 2015 14:26
Show Gist options
  • Save toh82/0ede5004353fb7eecbb9 to your computer and use it in GitHub Desktop.
Save toh82/0ede5004353fb7eecbb9 to your computer and use it in GitHub Desktop.
Extend Magento RTE with HTML 5 Tags
(function (getSettings) {
/**
* change standard behavior to not wrap code into <p>-tag
* and add some html5 tags
*
* @param mMode
* @returns {object}
*/
tinyMceWysiwygSetup.prototype.getSettings = function (mMode) {
var oSettings = getSettings.call(this, mMode);
/* for tiny mce >= 3.5 */
oSettings.forced_root_block = false;
/* for tiny mce < 3.5 */
oSettings.force_p_newlines = false;
oSettings.force_br_newlines = true;
//------------
oSettings.cleanup = false
var aHtml5Tags = [
'+object[*]'
];
oSettings.extended_valid_elements = aHtml5Tags.join();
// both seems not to work
//------------
oSettings.doctype = '<!DOCTYPE html>';
return oSettings;
};
}(tinyMceWysiwygSetup.prototype.getSettings));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment