[MediaWiki-commits] [Gerrit] Rename Redlinker to WikiLinkFixer - change (mediawiki...Flow)
jenkins-bot has submitted this change and it was merged. Change subject: Rename Redlinker to WikiLinkFixer .. Rename Redlinker to WikiLinkFixer This reflects that we're relying on this functionality for more than just red links. Change-Id: Ia3561e085b5b5fd6e739c5a4fe6a8ff576c26e70 --- M autoload.php M container.php M includes/Parsoid/Fixer/BaseHrefFixer.php R includes/Parsoid/Fixer/WikiLinkFixer.php R tests/phpunit/Parsoid/Fixer/WikiLinkFixerTest.php 5 files changed, 18 insertions(+), 21 deletions(-) Approvals: EBernhardson: Looks good to me, approved jenkins-bot: Verified diff --git a/autoload.php b/autoload.php index ed3e21d..efb1bd5 100644 --- a/autoload.php +++ b/autoload.php @@ -257,7 +257,7 @@ 'Flow\\Parsoid\\Fixer' = __DIR__ . '/includes/Parsoid/Fixer.php', 'Flow\\Parsoid\\Fixer\\BadImageRemover' = __DIR__ . '/includes/Parsoid/Fixer/BadImageRemover.php', 'Flow\\Parsoid\\Fixer\\BaseHrefFixer' = __DIR__ . '/includes/Parsoid/Fixer/BaseHrefFixer.php', - 'Flow\\Parsoid\\Fixer\\Redlinker' = __DIR__ . '/includes/Parsoid/Fixer/Redlinker.php', + 'Flow\\Parsoid\\Fixer\\WikiLinkFixer' = __DIR__ . '/includes/Parsoid/Fixer/WikiLinkFixer.php', 'Flow\\Parsoid\\ReferenceExtractor' = __DIR__ . '/includes/Parsoid/ReferenceExtractor.php', 'Flow\\Parsoid\\ReferenceFactory' = __DIR__ . '/includes/Parsoid/ReferenceFactory.php', 'Flow\\Parsoid\\Utils' = __DIR__ . '/includes/Parsoid/Utils.php', @@ -343,8 +343,8 @@ 'Flow\\Tests\\NotifiedUsersTest' = __DIR__ . '/tests/phpunit/Notifications/NotifiedUsersTest.php', 'Flow\\Tests\\PagerTest' = __DIR__ . '/tests/phpunit/PagerTest.php', 'Flow\\Tests\\Parsoid\\BadImageRemoverTest' = __DIR__ . '/tests/phpunit/Parsoid/Fixer/BadImageRemoverTest.php', - 'Flow\\Tests\\Parsoid\\Fixer\\MethodReturnsConstraint' = __DIR__ . '/tests/phpunit/Parsoid/Fixer/RedlinkerTest.php', - 'Flow\\Tests\\Parsoid\\Fixer\\RedlinkerTest' = __DIR__ . '/tests/phpunit/Parsoid/Fixer/RedlinkerTest.php', + 'Flow\\Tests\\Parsoid\\Fixer\\MethodReturnsConstraint' = __DIR__ . '/tests/phpunit/Parsoid/Fixer/WikiLinkFixerTest.php', + 'Flow\\Tests\\Parsoid\\Fixer\\WikiLinkFixerTest' = __DIR__ . '/tests/phpunit/Parsoid/Fixer/WikiLinkFixerTest.php', 'Flow\\Tests\\Parsoid\\ParsoidUtilsTest' = __DIR__ . '/tests/phpunit/Parsoid/UtilsTest.php', 'Flow\\Tests\\Parsoid\\ReferenceExtractorTestCase' = __DIR__ . '/tests/phpunit/Parsoid/ReferenceExtractorTest.php', 'Flow\\Tests\\Parsoid\\ReferenceFactoryTest' = __DIR__ . '/tests/phpunit/Parsoid/ReferenceFactoryTest.php', diff --git a/container.php b/container.php index 176e9d8..46f3a07 100644 --- a/container.php +++ b/container.php @@ -64,8 +64,8 @@ return new LinkBatch; }; -$c['redlinker'] = function( $c ) { - return new Flow\Parsoid\Fixer\Redlinker( $c['link_batch'] ); +$c['wiki_link_fixer'] = function( $c ) { + return new Flow\Parsoid\Fixer\WikiLinkFixer( $c['link_batch'] ); }; $c['bad_image_remover'] = function( $c ) { @@ -80,7 +80,7 @@ $c['content_fixer'] = function( $c ) { return new Flow\Parsoid\ContentFixer( - $c['redlinker'], + $c['wiki_link_fixer'], $c['bad_image_remover'], $c['base_href_fixer'] ); diff --git a/includes/Parsoid/Fixer/BaseHrefFixer.php b/includes/Parsoid/Fixer/BaseHrefFixer.php index 9621f09..86b8e27 100644 --- a/includes/Parsoid/Fixer/BaseHrefFixer.php +++ b/includes/Parsoid/Fixer/BaseHrefFixer.php @@ -11,7 +11,7 @@ * * For now, we just apply this transformation to our own user * Parsoid content. It does not need to be done for WikiLink, since - * that is handled by Redlinker in another way. + * that is handled by WikiLinkFixer in another way. */ class BaseHrefFixer implements Fixer { /** @@ -33,7 +33,7 @@ * @return string XPath of elements this acts on */ public function getXPath() { - // Redlinker handles mw:WikiLink + // WikiLinkFixer handles mw:WikiLink return '//a[@href and not(@rel=mw:WikiLink)]'; } diff --git a/includes/Parsoid/Fixer/Redlinker.php b/includes/Parsoid/Fixer/WikiLinkFixer.php similarity index 86% rename from includes/Parsoid/Fixer/Redlinker.php rename to includes/Parsoid/Fixer/WikiLinkFixer.php index c181423..5fa3139 100644 --- a/includes/Parsoid/Fixer/Redlinker.php +++ b/includes/Parsoid/Fixer/WikiLinkFixer.php @@ -14,27 +14,24 @@ /** * Parsoid ignores red links. With good reason: redlinks should only be - * applied when rendering the content, not when it's created. This - * class updates HTML content from Parsoid with anchors generated by - * Linker::link. + * applied when rendering the content, not when it's created. + * + * This class updates HTML content from Parsoid with anchors generated by + *
[MediaWiki-commits] [Gerrit] Rename Redlinker to WikiLinkFixer - change (mediawiki...Flow)
Mattflaschen has uploaded a new change for review. https://gerrit.wikimedia.org/r/196493 Change subject: Rename Redlinker to WikiLinkFixer .. Rename Redlinker to WikiLinkFixer This reflects that we're relying on this functionality for more than just red links. Change-Id: Ia3561e085b5b5fd6e739c5a4fe6a8ff576c26e70 --- M autoload.php M container.php M includes/Parsoid/Fixer/BaseHrefFixer.php R includes/Parsoid/Fixer/WikiLinkFixer.php R tests/phpunit/Parsoid/Fixer/WikiLinkFixerTest.php 5 files changed, 18 insertions(+), 21 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow refs/changes/93/196493/1 diff --git a/autoload.php b/autoload.php index ed3e21d..efb1bd5 100644 --- a/autoload.php +++ b/autoload.php @@ -257,7 +257,7 @@ 'Flow\\Parsoid\\Fixer' = __DIR__ . '/includes/Parsoid/Fixer.php', 'Flow\\Parsoid\\Fixer\\BadImageRemover' = __DIR__ . '/includes/Parsoid/Fixer/BadImageRemover.php', 'Flow\\Parsoid\\Fixer\\BaseHrefFixer' = __DIR__ . '/includes/Parsoid/Fixer/BaseHrefFixer.php', - 'Flow\\Parsoid\\Fixer\\Redlinker' = __DIR__ . '/includes/Parsoid/Fixer/Redlinker.php', + 'Flow\\Parsoid\\Fixer\\WikiLinkFixer' = __DIR__ . '/includes/Parsoid/Fixer/WikiLinkFixer.php', 'Flow\\Parsoid\\ReferenceExtractor' = __DIR__ . '/includes/Parsoid/ReferenceExtractor.php', 'Flow\\Parsoid\\ReferenceFactory' = __DIR__ . '/includes/Parsoid/ReferenceFactory.php', 'Flow\\Parsoid\\Utils' = __DIR__ . '/includes/Parsoid/Utils.php', @@ -343,8 +343,8 @@ 'Flow\\Tests\\NotifiedUsersTest' = __DIR__ . '/tests/phpunit/Notifications/NotifiedUsersTest.php', 'Flow\\Tests\\PagerTest' = __DIR__ . '/tests/phpunit/PagerTest.php', 'Flow\\Tests\\Parsoid\\BadImageRemoverTest' = __DIR__ . '/tests/phpunit/Parsoid/Fixer/BadImageRemoverTest.php', - 'Flow\\Tests\\Parsoid\\Fixer\\MethodReturnsConstraint' = __DIR__ . '/tests/phpunit/Parsoid/Fixer/RedlinkerTest.php', - 'Flow\\Tests\\Parsoid\\Fixer\\RedlinkerTest' = __DIR__ . '/tests/phpunit/Parsoid/Fixer/RedlinkerTest.php', + 'Flow\\Tests\\Parsoid\\Fixer\\MethodReturnsConstraint' = __DIR__ . '/tests/phpunit/Parsoid/Fixer/WikiLinkFixerTest.php', + 'Flow\\Tests\\Parsoid\\Fixer\\WikiLinkFixerTest' = __DIR__ . '/tests/phpunit/Parsoid/Fixer/WikiLinkFixerTest.php', 'Flow\\Tests\\Parsoid\\ParsoidUtilsTest' = __DIR__ . '/tests/phpunit/Parsoid/UtilsTest.php', 'Flow\\Tests\\Parsoid\\ReferenceExtractorTestCase' = __DIR__ . '/tests/phpunit/Parsoid/ReferenceExtractorTest.php', 'Flow\\Tests\\Parsoid\\ReferenceFactoryTest' = __DIR__ . '/tests/phpunit/Parsoid/ReferenceFactoryTest.php', diff --git a/container.php b/container.php index 176e9d8..46f3a07 100644 --- a/container.php +++ b/container.php @@ -64,8 +64,8 @@ return new LinkBatch; }; -$c['redlinker'] = function( $c ) { - return new Flow\Parsoid\Fixer\Redlinker( $c['link_batch'] ); +$c['wiki_link_fixer'] = function( $c ) { + return new Flow\Parsoid\Fixer\WikiLinkFixer( $c['link_batch'] ); }; $c['bad_image_remover'] = function( $c ) { @@ -80,7 +80,7 @@ $c['content_fixer'] = function( $c ) { return new Flow\Parsoid\ContentFixer( - $c['redlinker'], + $c['wiki_link_fixer'], $c['bad_image_remover'], $c['base_href_fixer'] ); diff --git a/includes/Parsoid/Fixer/BaseHrefFixer.php b/includes/Parsoid/Fixer/BaseHrefFixer.php index 6a1e68f..5529790 100644 --- a/includes/Parsoid/Fixer/BaseHrefFixer.php +++ b/includes/Parsoid/Fixer/BaseHrefFixer.php @@ -11,7 +11,7 @@ * * For now, we just apply this transformation to our own user * Parsoid content. It does not need to be done for WikiLink, since - * that is handled by Redlinker in another way. + * that is handled by WikiLinkFixer in another way. */ class BaseHrefFixer implements Fixer { /** @@ -30,7 +30,7 @@ * Returns XPath matching elements that need to be transformed */ public function getXPath() { - // Redlinker handles mw:WikiLink + // WikiLinkFixer handles mw:WikiLink return '//a[@href and not(@rel=mw:WikiLink)]'; } diff --git a/includes/Parsoid/Fixer/Redlinker.php b/includes/Parsoid/Fixer/WikiLinkFixer.php similarity index 86% rename from includes/Parsoid/Fixer/Redlinker.php rename to includes/Parsoid/Fixer/WikiLinkFixer.php index c181423..5fa3139 100644 --- a/includes/Parsoid/Fixer/Redlinker.php +++ b/includes/Parsoid/Fixer/WikiLinkFixer.php @@ -14,27 +14,24 @@ /** * Parsoid ignores red links. With good reason: redlinks should only be - * applied when rendering the content, not when it's created. This - * class updates HTML content from Parsoid with anchors generated by - * Linker::link. + * applied when rendering the content, not when it's created. + * + * This class