From 11ee99c799d1beefb18c21d5c88c5e5268811a0d Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Tue, 6 May 2014 12:56:10 +0000 Subject: [PATCH] added __CODE__::revision and #R --- codepot/src/codepot/libraries/wikihelper.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/codepot/src/codepot/libraries/wikihelper.php b/codepot/src/codepot/libraries/wikihelper.php index 9a45587f..65efdfe5 100644 --- a/codepot/src/codepot/libraries/wikihelper.php +++ b/codepot/src/codepot/libraries/wikihelper.php @@ -8,6 +8,12 @@ class WikiHelper function parseLink ($name, $projectid, $converter) { + if (preg_match ('/^#R([[:digit:]]+)$/', $name, $matches) == 1) + { + // #R123 -> translate it to code reivision. + $link = "code/revision/{$projectid}/2e/{$matches[1]}"; + return $link; + } if ($this->_is_reserved ($name, TRUE)) { $ex0 = $this->_trans_reserved ($name); @@ -94,6 +100,14 @@ class WikiHelper $link = "{$ex0}/{$ex[2]}/{$ex1}/{$ex3}"; return $link; } + else if ($ex[2] == 'revision') + { + // __CODE__::revision:178. + // 2e for the root directory. + if ($ex1 == NULL) return FALSE; + $link = "{$ex0}/{$ex[2]}/{$ex1}/2e/{$ex[3]}"; + return $link; + } return FALSE; }