Page MenuHomePhorge

D25234.1736670810.diff
No OneTemporary

D25234.1736670810.diff

diff --git a/src/infrastructure/markup/blockrule/PhutilRemarkupInterpreterBlockRule.php b/src/infrastructure/markup/blockrule/PhutilRemarkupInterpreterBlockRule.php
--- a/src/infrastructure/markup/blockrule/PhutilRemarkupInterpreterBlockRule.php
+++ b/src/infrastructure/markup/blockrule/PhutilRemarkupInterpreterBlockRule.php
@@ -2,6 +2,13 @@
final class PhutilRemarkupInterpreterBlockRule extends PhutilRemarkupBlockRule {
+ /**
+ * This regex tries to find something like:
+ * interpreterName {{{ stuff }}}
+ * And, also it tries to find this alternative:
+ * interpreterName (options) {{{ stuff }}}
+ * If you are asking, yep! You have found the kernel of cowsay and figlet!
+ */
const START_BLOCK_PATTERN = '/^([\w]+)\s*(?:\(([^)]+)\)\s*)?{{{/';
const END_BLOCK_PATTERN = '/}}}\s*$/';
@@ -74,16 +81,21 @@
$message = pht('No interpreter found: %s', $matches[1]);
+ // The syntax of this thing is so recondite that, showing a message,
+ // it simply risks making people screaming.
+ // Let's just log this information,
+ // preferring a "don't care strategy" on rendering.
+ phlog($message);
+
+ // After logging the error, just render the text as-is.
if ($this->getEngine()->isTextMode()) {
- return '('.$message.')';
+ return $text;
}
- return phutil_tag(
- 'div',
- array(
- 'class' => 'remarkup-interpreter-error',
- ),
- $message);
- }
+ if ($this->getEngine()->getConfig('preserve-linebreaks')) {
+ $text = phutil_escape_html_newlines($text);
+ }
+ return $text;
+ }
}

File Metadata

Mime Type
text/plain
Expires
Sun, Jan 12, 08:33 (6 d, 9 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1108711
Default Alt Text
D25234.1736670810.diff (1 KB)

Event Timeline