Page MenuHomec4science

PhutilRemarkupRuleDel.php
No OneTemporary

File Metadata

Created
Mon, Jul 28, 18:09

PhutilRemarkupRuleDel.php

<?php
/**
* @group markup
*/
final class PhutilRemarkupRuleDel
extends PhutilRemarkupRule {
public function getPriority() {
return 1000.0;
}
public function apply($text) {
if ($this->getEngine()->isTextMode()) {
return $text;
}
return $this->replaceHTML(
'@(?<!~)~~([^\s~].*?~*)~~@s',
array($this, 'applyCallback'),
$text);
}
protected function applyCallback($matches) {
return hsprintf('<del>%s</del>', $matches[1]);
}
}

Event Timeline