Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15382667
D15025.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D15025.diff
View Options
diff --git a/src/markup/engine/__tests__/remarkup/highlight.txt b/src/markup/engine/__tests__/remarkup/highlight.txt
--- a/src/markup/engine/__tests__/remarkup/highlight.txt
+++ b/src/markup/engine/__tests__/remarkup/highlight.txt
@@ -1,7 +1,9 @@
how about we !!highlight!! some !!TEXT!!!
wow this must be **!!very important!!**
+omg!!!!!
~~~~~~~~~~
<p>how about we <span class="remarkup-highlight">highlight</span> some <span class="remarkup-highlight">TEXT!</span>
-wow this must be <strong><span class="remarkup-highlight">very important</span></strong></p>
+wow this must be <strong><span class="remarkup-highlight">very important</span></strong>
+omg!!!!!</p>
~~~~~~~~~~
-how about we !!highlight!! some !!TEXT!!! wow this must be **!!very important!!**
+how about we !!highlight!! some !!TEXT!!! wow this must be **!!very important!!** omg!!!!!
diff --git a/src/markup/engine/remarkup/markuprule/PhutilRemarkupHighlightRule.php b/src/markup/engine/remarkup/markuprule/PhutilRemarkupHighlightRule.php
--- a/src/markup/engine/remarkup/markuprule/PhutilRemarkupHighlightRule.php
+++ b/src/markup/engine/remarkup/markuprule/PhutilRemarkupHighlightRule.php
@@ -21,6 +21,13 @@
// Remove the two exclamation points that represent syntax.
$excitement = substr($matches[2], 2);
+ // If the internal content consists of ONLY exclamation points, leave it
+ // untouched so "!!!!!" is five exclamation points instead of one
+ // highlighted exclamation point.
+ if (preg_match('/^!+\z/', $matches[1])) {
+ return $matches[0];
+ }
+
// $excitement now has two fewer !'s than we started with.
return hsprintf('<span class="remarkup-highlight">%s%s</span>',
$matches[1], $excitement);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 15, 1:44 PM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7694814
Default Alt Text
D15025.diff (1 KB)
Attached To
Mode
D15025: fix bug
Attached
Detach File
Event Timeline
Log In to Comment