1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-30 02:32:42 +01:00

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
This commit is contained in:
epriestley 2011-07-18 08:52:40 -07:00
parent c0ae2f6289
commit 87fa97e49a
3 changed files with 7 additions and 3 deletions

View file

@ -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 break existing installs. Newer changes are listed at the top. If you pull new
changes and things stop working, check here first! 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 June 29 2011 - Maniphest project indexes
Old Maniphest tasks will not appear in project filter views until you run 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 "scripts/search/reindex_maniphest.php" to build indexes. New tasks will have

View file

@ -147,9 +147,9 @@ if they aren't already CC'd.
You can link to Phriction documents with a name or path: 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 With a pipe (##|##), you can retitle the link. Use this to mislead your
opponents: opponents:
Check out these [legal/boring_documents/ | exciting legal documents]! Check out these [[legal/boring_documents/ | exciting legal documents]]!

View file

@ -24,7 +24,7 @@ class PhabricatorRemarkupRulePhriction
public function apply($text) { public function apply($text) {
return preg_replace_callback( return preg_replace_callback(
'@\B\\[([^|\\]]+)(?:\\|([^\\]]+))?\\]\B@U', '@\B\\[\\[([^|\\]]+)(?:\\|([^\\]]+))?\\]\\]\B@U',
array($this, 'markupDocumentLink'), array($this, 'markupDocumentLink'),
$text); $text);
} }