mirror of
https://github.com/diocloid/LinkTitles.git
synced 2025-07-13 09:49:31 +02:00
Do not remove magic word when saving page.
This commit is contained in:
@ -42,6 +42,7 @@
|
||||
if ( $wgLinkTitlesParseOnRender ) {
|
||||
$wgHooks['ArticleAfterFetchContent'][] = 'LinkTitles::onArticleAfterFetchContent';
|
||||
};
|
||||
$wgHooks['ParserBeforeTidy'][] = 'LinkTitles::removeMagicWord';
|
||||
}
|
||||
|
||||
/// This function is hooked to the ArticleSave event.
|
||||
@ -76,7 +77,7 @@
|
||||
// If the page contains the magic word '__NOAUTOLINKS__', do not parse
|
||||
// the content.
|
||||
$mw = MagicWord::get('MAG_LINKTITLES_NOAUTOLINKS');
|
||||
if ( $mw -> matchAndRemove( $text ) ) {
|
||||
if ( $mw -> match( $text ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -200,6 +201,12 @@
|
||||
return '[[' . LinkTitles::$safeTitle . '|' . $matches[0] . ']]';
|
||||
}
|
||||
}
|
||||
|
||||
function removeMagicWord( &$parser, &$text ) {
|
||||
$mw = MagicWord::get('MAG_LINKTITLES_NOAUTOLINKS');
|
||||
$mw -> matchAndRemove( $text );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// vim: ts=2:sw=2:noet
|
||||
|
Reference in New Issue
Block a user