Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2902189
D25234.1737297078.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
D25234.1737297078.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 19, 14:31 (15 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1108711
Default Alt Text
D25234.1737297078.diff (1 KB)
Attached To
Mode
D25234: Fix exception and error message rendering some markup matching figlet/cowsay regex
Attached
Detach File
Event Timeline
Log In to Comment