diff --git a/LinkTitles.body.php b/LinkTitles.body.php index 1c409d3..b969579 100755 --- a/LinkTitles.body.php +++ b/LinkTitles.body.php @@ -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 diff --git a/LinkTitles.i18n.magic.php b/LinkTitles.i18n.magic.php index 4c35011..5d753b8 100644 --- a/LinkTitles.i18n.magic.php +++ b/LinkTitles.i18n.magic.php @@ -5,6 +5,6 @@ $magicWords = array(); $magicWords['en'] = array( - 'MAG_LINKTITLES_NOAUTOLINKS' => '__NOAUTOLINKS__', + 'MAG_LINKTITLES_NOAUTOLINKS' => array(0, '__NOAUTOLINKS__') ); diff --git a/NEWS b/NEWS index 7d5172f..385b97c 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +LinkTitles 2.1.0: 2013-02-23 +* Introduced new 'magic word' __NOAUTOLINKS__, whose presence on a page will + prevent the extension from adding links. + LinkTitles 2.0.0: 2013-01-29 * Introduced a new 'smart mode' ($wgLinkTitlesSmartMode) which is enabled by default and will automatically generate aliased links if there is a case diff --git a/release/LinkTitles-2.1.0.tar.gz b/release/LinkTitles-2.1.0.tar.gz new file mode 100644 index 0000000..78aad18 Binary files /dev/null and b/release/LinkTitles-2.1.0.tar.gz differ