C. Scott Ananian has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/396049 )

Change subject: WIP/Concept: Handle [ as well as [[ in the preprocessor
......................................................................

WIP/Concept: Handle [ as well as [[ in the preprocessor

This prevents unexpected assymmetries in how external and wikilinks
are preprocessed and parsed.

Side-effect: [http://example.com [foo] *was* a link with link text `[foo`;
now it's (reading left to right) a literal open bracker, an autolink to
example.com, and an illegal extlink to `foo`.

TODO: Similarly, [[Foo|[foo]]] should be a wikilink with a caption of `[foo]`.

TODO: Refuse to match a [ in [ context, but allow in [[ context?
[[http://example.com foo] should work...

Change-Id: Icce6498cb454b6130c9eda59eee9c97b2253108e
---
M includes/parser/Preprocessor.php
1 file changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/49/396049/1

diff --git a/includes/parser/Preprocessor.php b/includes/parser/Preprocessor.php
index 49e961a..269b0d7 100644
--- a/includes/parser/Preprocessor.php
+++ b/includes/parser/Preprocessor.php
@@ -45,8 +45,11 @@
                ],
                '[' => [
                        'end' => ']',
-                       'names' => [ 2 => null ],
-                       'min' => 2,
+                       'names' => [
+                               1 => null,
+                               2 => null,
+                       ],
+                       'min' => 1,
                        'max' => 2,
                ],
                '-{' => [

-- 
To view, visit https://gerrit.wikimedia.org/r/396049
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icce6498cb454b6130c9eda59eee9c97b2253108e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: C. Scott Ananian <canan...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to