Révision c8740e19
Ajouté par Assos Assos il y a plus de 9 ans
drupal7/sites/all/modules/highlightjs/contrib/highlight_js_filter/highlight_js_filter.module | ||
---|---|---|
17 | 17 |
'prepare callback' => '_highlight_js_filter_prepare', |
18 | 18 |
'process callback' => '_highlight_js_filter_process', |
19 | 19 |
'tips callback' => '_highlight_js_filter_tips', |
20 |
'cache' => FALSE,
|
|
20 |
'cache' => TRUE,
|
|
21 | 21 |
); |
22 | 22 |
return $filters; |
23 | 23 |
} |
... | ... | |
38 | 38 |
/** |
39 | 39 |
* Prepare callback for Highlight JS filter. |
40 | 40 |
*/ |
41 |
function _highlight_js_filter_prepare($text, $format) { |
|
42 |
$text = preg_replace_callback('@<code>(.+?)</code>@s', '_highlight_js_filter_escape_code_tag_callback', $text); |
|
43 |
$text = preg_replace_callback('@<code class="(.+?)">(.+?)</code>@s', '_highlight_js_filter_escape_code_tag_lang_callback', $text); |
|
41 |
function _highlight_js_filter_prepare($text) { |
|
42 |
$text = preg_replace_callback('@^<\?php(.+?)\?>@sm', '_highlight_js_filter_escape_code_tag_callback', $text); |
|
43 |
$text = preg_replace_callback('@^<code>(.+?)</code>@sm', '_highlight_js_filter_escape_code_tag_callback', $text); |
|
44 |
$text = preg_replace_callback('@^<code class="(.+?)">(.+?)</code>@sm', '_highlight_js_filter_escape_code_tag_lang_callback', $text); |
|
44 | 45 |
return $text; |
45 | 46 |
} |
46 | 47 |
|
Formats disponibles : Unified diff
Weekly update of contrib modules