Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/infrastructure/markup/markuprule/PhutilRemarkupEscapeRemarkupRule.php
12241 views
1
<?php
2
3
final class PhutilRemarkupEscapeRemarkupRule extends PhutilRemarkupRule {
4
5
public function getPriority() {
6
return 0;
7
}
8
9
public function apply($text) {
10
if (strpos($text, "\1") === false) {
11
return $text;
12
}
13
14
$replace = $this->getEngine()->storeText("\1");
15
16
return str_replace("\1", $replace, $text);
17
}
18
19
}
20
21