File tree 4 files changed +24
-4
lines changed
infrastructure/markup/rule
4 files changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ final class DivinerRemarkupRuleSymbol extends PhutilRemarkupRule {
5
5
const KEY_RULE_ATOM_REF = 'rule.diviner.atomref ' ;
6
6
7
7
public function getPriority () {
8
- return 40 .0 ;
8
+ return 200 .0 ;
9
9
}
10
10
11
11
public function apply ($ text ) {
@@ -34,6 +34,10 @@ public function apply($text) {
34
34
}
35
35
36
36
public function markupSymbol ($ matches ) {
37
+ if ($ this ->isTextFlat ($ matches [0 ])) {
38
+ return $ matches [0 ];
39
+ }
40
+
37
41
$ type = (string )idx ($ matches , 'type ' );
38
42
$ name = (string )$ matches ['name ' ];
39
43
$ title = (string )idx ($ matches , 'title ' );
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ final class PhabricatorRemarkupRuleIcon
4
4
extends PhutilRemarkupRule {
5
5
6
6
public function getPriority () {
7
- return 50 .0 ;
7
+ return 200 .0 ;
8
8
}
9
9
10
10
public function apply ($ text ) {
@@ -15,6 +15,10 @@ public function apply($text) {
15
15
}
16
16
17
17
public function markupIcon ($ matches ) {
18
+ if (!$ this ->isFlatText ($ matches [0 ])) {
19
+ return $ matches [0 ];
20
+ }
21
+
18
22
$ extra = idx ($ matches , 1 );
19
23
20
24
// We allow various forms, like these:
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ final class PhabricatorRemarkupRuleMeme
9
9
private $ images ;
10
10
11
11
public function getPriority () {
12
- return 50 .0 ;
12
+ return 200 .0 ;
13
13
}
14
14
15
15
public function apply ($ text ) {
@@ -20,6 +20,10 @@ public function apply($text) {
20
20
}
21
21
22
22
public function markupMeme ($ matches ) {
23
+ if (!$ this ->isFlatText ($ matches [0 ])) {
24
+ return $ matches [0 ];
25
+ }
26
+
23
27
$ options = array (
24
28
'src ' => null ,
25
29
'above ' => null ,
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ abstract protected function getObjectNamePrefix();
13
13
abstract protected function loadObjects (array $ ids );
14
14
15
15
public function getPriority () {
16
- return 50 .0 ;
16
+ return 200 .0 ;
17
17
}
18
18
19
19
protected function getObjectNamePrefixBeginsWithWordCharacter () {
@@ -133,6 +133,10 @@ public function apply($text) {
133
133
}
134
134
135
135
public function markupObjectEmbed ($ matches ) {
136
+ if (!$ this ->isFlatText ($ matches [0 ])) {
137
+ return $ matches [0 ];
138
+ }
139
+
136
140
return $ this ->markupObject (array (
137
141
'type ' => 'embed ' ,
138
142
'id ' => $ matches [1 ],
@@ -142,6 +146,10 @@ public function markupObjectEmbed($matches) {
142
146
}
143
147
144
148
public function markupObjectReference ($ matches ) {
149
+ if (!$ this ->isFlatText ($ matches [0 ])) {
150
+ return $ matches [0 ];
151
+ }
152
+
145
153
return $ this ->markupObject (array (
146
154
'type ' => 'ref ' ,
147
155
'id ' => $ matches [1 ],
You can’t perform that action at this time.
0 commit comments