12c12 < * +optimizes the code so that nothing is done, including loading the jquery & css files, if the marker does not appear in the text --- > * +optimizes the code so that nothing is done, including loading the jquery & css files, if the [[TOC]] marker does not appear in the text 17c17 < * +made the regex match for options on the marker tolerant of spaces --- > * +made the regex match for options on the [[TOC]] marker tolerant of spaces 42c42 < return t('Every instance of "<!--tableofcontents-->" in the input text will be replaced with a collapsible mediawiki-style table of contents. Accepts options for title, list style, minimum heading level, and maximum heading level as follows: <!--tableofcontents list: ol; title: Table of Contents; minlevel: 1; maxlevel: 3;-->. All arguments are optional and defaults are shown.'); --- > return t('Every instance of "[[TOC]]" in the input text will be replaced with a collapsible mediawiki-style table of contents. Accepts options for title, list style, minimum heading level, and maximum heading level as follows: [[TOC list: ol; title: Table of Contents; minlevel: 1; maxlevel: 3;]]. All arguments are optional and defaults are shown.'); 45c45 < return t('Insert <!--tableofcontents [list: ol; title: Table of Contents; minlevel: 1; maxlevel: 3;]--> to insert a mediawiki style collapsible table of contents. Arguments within [] are optional (defaults are shown).'); --- > return t('Insert [[TOC list: ol; title: Table of Contents; minlevel: 1; maxlevel: 3;]] to insert a mediawiki style collapsible table of contents. Arguments are optional (defaults are shown).'); 62c62 < return t('Inserts a table of contents in the place of <!--tableofcontents--> tags.'); --- > return t('Inserts a table of contents in the place of [[TOC]] tags.'); 71c71,72 < preg_match_all('!<\!-- ?tableofcontents(.*)-->!', $text, $options_str, PREG_PATTERN_ORDER); --- > //preg_match_all('!<\!-- ?tableofcontents(.*)-->!', $text, $options_str, PREG_PATTERN_ORDER); > preg_match_all('!\[\[TOC(.*)\]\]!', $text, $options_str, PREG_PATTERN_ORDER); 166c167,168 < preg_match('!<\!-- ?tableofcontents(.*)-->!', $text, $matches, PREG_OFFSET_CAPTURE); --- > //preg_match('!<\!-- ?tableofcontents(.*)-->!', $text, $matches, PREG_OFFSET_CAPTURE); > preg_match('!\[\[TOC(.*)\]\]!', $text, $matches, PREG_OFFSET_CAPTURE); 245c247,248 < return preg_replace('!<\!-- ?tableofcontents(.*)-->!', $toc_html, $text); --- > return preg_replace('!\[\[TOC(.*)\]\]!', $toc_html, $text); > //return preg_replace('!<\!-- ?tableofcontents(.*)-->!', $toc_html, $text);