Index: trunk/phase3/includes/Parser.php |
— | — | @@ -3641,12 +3641,21 @@ |
3642 | 3642 | "\$this->mInterwikiLinkHolders['texts'][\$1]", |
3643 | 3643 | $canonized_headline ); |
3644 | 3644 | |
3645 | | - # strip out HTML |
3646 | | - $canonized_headline = preg_replace( '/<.*?' . '>/','',$canonized_headline ); |
3647 | | - $tocline = trim( $canonized_headline ); |
| 3645 | + # Strip out HTML (other than plain <sup> and <sub>: bug 8393) |
| 3646 | + $tocline = preg_replace( |
| 3647 | + array( '#<(?!/?(sup|sub)).*?'.'>#', '#<(/?(sup|sub)).*?'.'>#' ), |
| 3648 | + array( '', '<$1>'), |
| 3649 | + $canonized_headline |
| 3650 | + ); |
| 3651 | + $tocline = trim( $tocline ); |
| 3652 | + |
| 3653 | + # For the anchor, strip out HTML-y stuff period |
| 3654 | + $canonized_headline = preg_replace( '/<.*?'.'>/', '', $canonized_headline ); |
| 3655 | + $canonized_headline = trim( $canonized_headline ); |
| 3656 | + |
3648 | 3657 | # Save headline for section edit hint before it's escaped |
3649 | | - $headline_hint = trim( $canonized_headline ); |
3650 | | - $canonized_headline = Sanitizer::escapeId( $tocline ); |
| 3658 | + $headline_hint = $canonized_headline; |
| 3659 | + $canonized_headline = Sanitizer::escapeId( $canonized_headline ); |
3651 | 3660 | $refers[$headlineCount] = $canonized_headline; |
3652 | 3661 | |
3653 | 3662 | # count how many in assoc. array so we can track dupes in anchors |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -424,6 +424,8 @@ |
425 | 425 | * (bug 11072) Fix regression in API image history query |
426 | 426 | * (bug 10985) Resolved cached entries on Special:DoubleRedirects were being |
427 | 427 | supressed, breaking paging - now strikes out "fixed" results |
| 428 | +* (bug 8393) <sup> and <sub> need to be preserved (without attributes) for |
| 429 | + entries in the table of contents |
428 | 430 | |
429 | 431 | == API changes since 1.10 == |
430 | 432 | |