Differences Between: [Versions 402 and 403]
This filter provides automatic support for MathJax
Copyright: | 2013 Damyon Wiese (damyon@moodle.com) |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 249 lines (10 kb) |
Included or required: | 0 times |
Referenced: | 2 times |
Includes or requires: | 0 files |
filter_mathjaxloader:: (5 methods):
map_language_code()
setup()
filter()
wrap_math_in_nolink()
insert_span()
Class: filter_mathjaxloader - X-Ref
Mathjax filteringmap_language_code($moodlelangcode) X-Ref |
No description |
setup($page, $context) X-Ref |
No description |
filter($text, array $options = array() X-Ref |
No description |
wrap_math_in_nolink($text) X-Ref |
Find math environments in the $text and wrap them in no link spans (<span class="nolink"></span>). If math environments are nested, only the outer environment is wrapped in the span. The recognized math environments are \[ \] and $$ $$ for display mathematics and \( \) for inline mathematics. param: string $text The text to filter. return: array An array containing the potentially modified text and |
insert_span($text, $start, $end) X-Ref |
Wrap a portion of the $text inside a no link span (<span class="nolink"></span>). The whole text is then returned. param: string $text The text to modify. param: int $start The start index of the substring in $text that should param: int $end The end index of the substring in $text that should be return: string The whole $text with the span inserted around |