From d57c1d6ce2f5d4b311b8b55dd154097262572149 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 12 Jan 2016 09:27:00 -0800 Subject: [PATCH] Make hashtags at the end of bolded text render properly Summary: Fixes T10096. The `**` was being parsed as part of the hashtag, so `**#asdf**` interpreted `#asdf**` as a hashtag. Test Plan: Unit test; bolded stuff with hashy contents. Reviewers: chad Reviewed By: chad Maniphest Tasks: T10096 Differential Revision: https://secure.phabricator.com/D15006 --- .../project/remarkup/ProjectRemarkupRule.php | 2 +- .../remarkup/__tests__/ProjectRemarkupRuleTestCase.php | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/applications/project/remarkup/ProjectRemarkupRule.php b/src/applications/project/remarkup/ProjectRemarkupRule.php index 5eeddeabfe..43253e5b67 100644 --- a/src/applications/project/remarkup/ProjectRemarkupRule.php +++ b/src/applications/project/remarkup/ProjectRemarkupRule.php @@ -32,7 +32,7 @@ final class ProjectRemarkupRule extends PhabricatorObjectRemarkupRule { // controlling and these names should parse correctly. // These characters may never appear anywhere in a hashtag. - $never = '\s?!,:;{}#\\(\\)"\''; + $never = '\s?!,:;{}#\\(\\)"\'\\*/~'; // These characters may not appear at the edge of the string. $never_edge = '.'; diff --git a/src/applications/project/remarkup/__tests__/ProjectRemarkupRuleTestCase.php b/src/applications/project/remarkup/__tests__/ProjectRemarkupRuleTestCase.php index 3789a424dd..5adbfbfe90 100644 --- a/src/applications/project/remarkup/__tests__/ProjectRemarkupRuleTestCase.php +++ b/src/applications/project/remarkup/__tests__/ProjectRemarkupRuleTestCase.php @@ -125,6 +125,16 @@ final class ProjectRemarkupRuleTestCase extends PhabricatorTestCase { ), ), + '**#orbital**' => array( + 'embed' => array(), + 'ref' => array( + array( + 'offset' => 3, + 'id' => 'orbital', + ), + ), + ), + ); foreach ($cases as $input => $expect) {