From 48f72b57b282bff3142e481044394e8de716c112 Mon Sep 17 00:00:00 2001 From: Andrew Gallagher Date: Tue, 3 Jan 2012 16:17:40 -0800 Subject: [PATCH] Enable use of remarkup literal block Summary: D1293 adds support for a literal block in remarkup. This diff enables it in phabricator with a few basic rules (for line breaks, escaping HTML, and linkifying URLs). Test Plan: Tested in sandbox Reviewers: epriestley, jungejason Reviewed By: epriestley CC: aran, epriestley Differential Revision: https://secure.phabricator.com/D1297 --- .../markup/engine/PhabricatorMarkupEngine.php | 12 ++++++++++-- src/applications/markup/engine/__init__.php | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/applications/markup/engine/PhabricatorMarkupEngine.php b/src/applications/markup/engine/PhabricatorMarkupEngine.php index bf2370118e..efa01f5a4e 100644 --- a/src/applications/markup/engine/PhabricatorMarkupEngine.php +++ b/src/applications/markup/engine/PhabricatorMarkupEngine.php @@ -1,7 +1,7 @@ setMarkupRules($literal_rules); + } else if ( + !($block instanceof PhutilRemarkupEngineRemarkupCodeBlockRule)) { $block->setMarkupRules($rules); } } diff --git a/src/applications/markup/engine/__init__.php b/src/applications/markup/engine/__init__.php index 6101da6527..48466fc9c7 100644 --- a/src/applications/markup/engine/__init__.php +++ b/src/applications/markup/engine/__init__.php @@ -25,6 +25,7 @@ phutil_require_module('phutil', 'markup/engine/remarkup/blockrule/remarkupcode') phutil_require_module('phutil', 'markup/engine/remarkup/blockrule/remarkupdefault'); phutil_require_module('phutil', 'markup/engine/remarkup/blockrule/remarkupheader'); phutil_require_module('phutil', 'markup/engine/remarkup/blockrule/remarkuplist'); +phutil_require_module('phutil', 'markup/engine/remarkup/blockrule/remarkupliteral'); phutil_require_module('phutil', 'markup/engine/remarkup/blockrule/remarkupnote'); phutil_require_module('phutil', 'markup/engine/remarkup/blockrule/remarkupquotes'); phutil_require_module('phutil', 'markup/engine/remarkup/markuprule/bold'); @@ -32,6 +33,7 @@ phutil_require_module('phutil', 'markup/engine/remarkup/markuprule/escapehtml'); phutil_require_module('phutil', 'markup/engine/remarkup/markuprule/escaperemarkup'); phutil_require_module('phutil', 'markup/engine/remarkup/markuprule/hyperlink'); phutil_require_module('phutil', 'markup/engine/remarkup/markuprule/italics'); +phutil_require_module('phutil', 'markup/engine/remarkup/markuprule/linebreaks'); phutil_require_module('phutil', 'markup/engine/remarkup/markuprule/monospace'); phutil_require_module('phutil', 'symbols'); phutil_require_module('phutil', 'utils');