Index: trunk/phase3/includes/Parser.php |
— | — | @@ -3405,7 +3405,13 @@ |
3406 | 3406 | } |
3407 | 3407 | |
3408 | 3408 | /** |
3409 | | - * Detect __TOC__ magic word and set a placeholder |
| 3409 | + * Find the first __TOC__ magic word and set a <!--MWTOC--> |
| 3410 | + * placeholder that will then be replaced by the real TOC in |
| 3411 | + * ->formatHeadings, this works because at this points real |
| 3412 | + * comments will have already been discarded by the sanitizer. |
| 3413 | + * |
| 3414 | + * Any additional __TOC__ magic words left over will be discarded |
| 3415 | + * as there can only be one TOC on the page. |
3410 | 3416 | */ |
3411 | 3417 | function stripToc( $text ) { |
3412 | 3418 | # if the string __NOTOC__ (not case-sensitive) occurs in the HTML, |