Page MenuHomePhorge

PhutilRemarkupUnderlineRule.php
No OneTemporary

PhutilRemarkupUnderlineRule.php

<?php
final class PhutilRemarkupUnderlineRule extends PhutilRemarkupRule {
public function getPriority() {
return 1000.0;
}
public function apply($text) {
if ($this->getEngine()->isTextMode()) {
return $text;
}
return $this->replaceHTML(
'@(?<!_|/)__([^\s_/].*?_*)__(?!/|\.\S)@s',
array($this, 'applyCallback'),
$text);
}
protected function applyCallback(array $matches) {
return hsprintf('<u>%s</u>', $matches[1]);
}
}

File Metadata

Mime Type
text/x-php
Expires
Jan 19 2025, 17:40 (6 w, 9 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1127061
Default Alt Text
PhutilRemarkupUnderlineRule.php (482 B)

Event Timeline