BUG#206: replace <!--LINK tags by the link text for displaying text in TOCs

Thanks to Daniel D�sentrieb for his help writing the regexp.
This commit is contained in:
Jens Frank 2004-08-26 18:48:13 +00:00
parent 5edddf8238
commit 3d4d040658

View file

@ -1959,6 +1959,11 @@ class Parser
$canonized_headline = $this->unstrip( $headline, $this->mStripState );
$canonized_headline = $this->unstripNoWiki( $headline, $this->mStripState );
# Remove link placeholders by the link text.
# <!--LINK namespace page_title link text with suffix-->
# turns into
# link text with suffix
$canonized_headline = preg_replace( '/<!--LINK [0-9]* [^ ]* *(.*?)-->/','$1', $canonized_headline );
# strip out HTML
$canonized_headline = preg_replace( '/<.*?' . '>/','',$canonized_headline );
$tocline = trim( $canonized_headline );