Page MenuHomestyx hydra

PhutilRemarkupItalicRule.php
No OneTemporary

PhutilRemarkupItalicRule.php

<?php
final class PhutilRemarkupItalicRule extends PhutilRemarkupRule {
public function getPriority() {
return 1000.0;
}
public function apply($text) {
if ($this->getEngine()->isTextMode()) {
return $text;
}
return $this->replaceHTML(
'@(?<!:)//(.+?)//@s',
array($this, 'applyCallback'),
$text);
}
protected function applyCallback(array $matches) {
return hsprintf('<em>%s</em>', $matches[1]);
}
}

File Metadata

Mime Type
text/x-php
Expires
Wed, Dec 3, 12:33 AM (4 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
432995
Default Alt Text
PhutilRemarkupItalicRule.php (460 B)

Event Timeline