AnsPress_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/free/syntaxhighlighter.php
public static function mce_before_init( $options ) { if ( ! isset( $options['extended_valid_elements'] ) ) { $options['extended_valid_elements'] = ''; } else { $options['extended_valid_elements'] .= ','; } if ( ! isset( $options['custom_elements'] ) ) { $options['custom_elements'] = ''; } else { $options['custom_elements'] .= ','; } $options['extended_valid_elements'] .= 'pre[aplang|contenteditable]'; $options['custom_elements'] .= 'pre[aplang|contenteditable]'; return $options; }
Expand full source code Collapse full source code View on GitHub: addons/free/syntaxhighlighter.php:205
Add your comment