Syntax_Highlighter::mce_before_init( array $options )
Description #
Modify tinyMCE options so that we can add our pre tags along with language code.
Our language code is stored in a custom attribute aplang. Also whitelist contenteditable attribute so that we can prevent editing pre tag in editor.
Parameters #
- $optionsarray (Required) TinyMCE options.
Source #
File: addons/syntaxhighlighter/syntaxhighlighter.php
public function mce_before_init( $options ) {
if ( ! isset( $options['extended_valid_elements'] ) ) {
$options['extended_valid_elements'] = '';
} else {
$options['extended_valid_elements'] .= ',';
}
$options['extended_valid_elements'] = 'pre,code';
return $options;
}
Expand full source code Collapse full source code View on GitHub: addons/syntaxhighlighter/syntaxhighlighter.php:138
Add your comment