Skip to content

Commit

Permalink
Don't highlight hyperlinks in monospaced text
Browse files Browse the repository at this point in the history
Summary:
It should be possible to denote unclickable hyperlinks somehow.

NOTE: BC break, it will cause double escaping if applied after EscapeHTML.

Test Plan: Write `Error connecting to http://127.0.0.1/`.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D1913
  • Loading branch information
vrana committed Mar 15, 2012
1 parent 1ce62c5 commit 03fdf19
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Expand Up @@ -60,9 +60,9 @@ private function buildNewTestEngine() {

$rules = array();
$rules[] = new PhutilRemarkupRuleEscapeRemarkup();
$rules[] = new PhutilRemarkupRuleMonospace();
$rules[] = new PhutilRemarkupRuleHyperlink();
$rules[] = new PhutilRemarkupRuleEscapeHTML();
$rules[] = new PhutilRemarkupRuleMonospace();
$rules[] = new PhutilRemarkupRuleBold();
$rules[] = new PhutilRemarkupRuleItalic();

Expand Down
Expand Up @@ -32,7 +32,7 @@ public function apply($text) {
private function markupMonospacedText($matches) {
$match = isset($matches[2]) ? $matches[2] : $matches[1];

$result = '<tt>'.$match.'</tt>';
$result = '<tt>'.phutil_escape_html($match).'</tt>';

return $this->getEngine()->storeText($result);
}
Expand Down
Expand Up @@ -6,6 +6,7 @@



phutil_require_module('phutil', 'markup');
phutil_require_module('phutil', 'markup/engine/remarkup/markuprule/base');


Expand Down

0 comments on commit 03fdf19

Please sign in to comment.