mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-22 13:30:55 +01:00
Adding ':' as a supported character in Macros.
Summary: Adding ':' in order to support SA-style smiley conventions (e.g: :allears:) in Phabricator. Test Plan: Tested working on local Phabricator copy. Reviewers: epriestley Reviewed By: epriestley CC: aran, epriestley, Korvin Differential Revision: https://secure.phabricator.com/D4727
This commit is contained in:
parent
1ebd51aad2
commit
fd6a13558f
2 changed files with 5 additions and 5 deletions
|
@ -39,10 +39,10 @@ final class PhabricatorMacroEditController
|
|||
if (!strlen($macro->getName())) {
|
||||
$errors[] = pht('Macro name is required.');
|
||||
$e_name = pht('Required');
|
||||
} else if (!preg_match('/^[a-z0-9_-]{3,}$/', $macro->getName())) {
|
||||
$errors[] = pht('Macro must be at least three characters long and '.
|
||||
'contain only lowercase letters, digits, hyphen and '.
|
||||
'underscore.');
|
||||
} else if (!preg_match('/^[a-z0-9:_-]{3,}$/', $macro->getName())) {
|
||||
$errors[] = pht(
|
||||
'Macro must be at least three characters long and contain only '.
|
||||
'lowercase letters, digits, hyphens, colons and underscores.');
|
||||
$e_name = pht('Invalid');
|
||||
} else {
|
||||
$e_name = null;
|
||||
|
|
|
@ -10,7 +10,7 @@ final class PhabricatorRemarkupRuleImageMacro
|
|||
|
||||
public function apply($text) {
|
||||
return preg_replace_callback(
|
||||
'@^([a-zA-Z0-9_\-]+)$@m',
|
||||
'@^([a-zA-Z0-9:_\-]+)$@m',
|
||||
array($this, 'markupImageMacro'),
|
||||
$text);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue