From 87fa97e49aafe5ddd71c81d84416b2aa69c2f5ed Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 18 Jul 2011 08:52:40 -0700 Subject: [PATCH] Require double brackets for Phriction links Summary: Single brackets are getting some troublesome false positives in Facebook's install. Particularly, there's a weird convention at Facebook of tagging diffs by putting stuff like "[perf]" or "[chat]" in the title, although this isn't turned into structured data at any stage. When commits appear in Diffusion, we currently link such ad-hoc tags to Phriction. Wikipedia uses double-bracket sytnax, as do many other wikis, so this seems like a reasonable burden to place on the lightweightness of the markup. The alternative is selectively disabling Phriction markup in some interfaces, but I'd rather allow integration in commit messages and just guard the syntax more closely. (I'm not providing any sort of migration plan since this landed less than a week ago and I'm pretty confident no one has built a huge wiki yet, but I added a CHANGELOG note.) Test Plan: Edited a wiki document and added some links. Verified single brackets were unlinked and double brackets were linked. Reviewed By: jungejason Reviewers: hsb, aran, jungejason, tuomaspelkonen CC: aran, jungejason, epriestley Differential Revision: 689 --- CHANGELOG | 4 ++++ src/docs/userguide/remarkup.diviner | 4 ++-- .../markuprule/phriction/PhabricatorRemarkupRulePhriction.php | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 171beb5130..217a87d9ac 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,10 @@ This is not a complete list of changes, just of API or workflow changes that may break existing installs. Newer changes are listed at the top. If you pull new changes and things stop working, check here first! +July 18 2011 - Phriction Link Syntax Change + Phriction link sytnax now requires [[double brackets]], not single + brackets. + June 29 2011 - Maniphest project indexes Old Maniphest tasks will not appear in project filter views until you run "scripts/search/reindex_maniphest.php" to build indexes. New tasks will have diff --git a/src/docs/userguide/remarkup.diviner b/src/docs/userguide/remarkup.diviner index 034b965eb5..4bb3ab6b79 100644 --- a/src/docs/userguide/remarkup.diviner +++ b/src/docs/userguide/remarkup.diviner @@ -147,9 +147,9 @@ if they aren't already CC'd. You can link to Phriction documents with a name or path: - Make sure you sign and date your [legal/Letter of Marque and Reprisal]! + Make sure you sign and date your [[legal/Letter of Marque and Reprisal]]! With a pipe (##|##), you can retitle the link. Use this to mislead your opponents: - Check out these [legal/boring_documents/ | exciting legal documents]! + Check out these [[legal/boring_documents/ | exciting legal documents]]! diff --git a/src/infrastructure/markup/remarkup/markuprule/phriction/PhabricatorRemarkupRulePhriction.php b/src/infrastructure/markup/remarkup/markuprule/phriction/PhabricatorRemarkupRulePhriction.php index b33bc3c941..66259dbafa 100644 --- a/src/infrastructure/markup/remarkup/markuprule/phriction/PhabricatorRemarkupRulePhriction.php +++ b/src/infrastructure/markup/remarkup/markuprule/phriction/PhabricatorRemarkupRulePhriction.php @@ -24,7 +24,7 @@ class PhabricatorRemarkupRulePhriction public function apply($text) { return preg_replace_callback( - '@\B\\[([^|\\]]+)(?:\\|([^\\]]+))?\\]\B@U', + '@\B\\[\\[([^|\\]]+)(?:\\|([^\\]]+))?\\]\\]\B@U', array($this, 'markupDocumentLink'), $text); }