Page MenuHomePhabricator

Bare_img_tag_support_in_remarkup,_like_P1129

Authored By
bougyman
Oct 2 2014, 7:12 PM
Size
586 B
Referenced Files
None
Subscribers
None

Bare_img_tag_support_in_remarkup,_like_P1129

<?php
final class CustomInlineCodeRule extends PhabricatorRemarkupCustomInlineRule {
public function apply($text) {
return preg_replace_callback(
'{<img.*?src="(.*?)".*?>}s',
array($this, 'markupInlineCodeBlock'),
$text);
}
public function getPriority() {
return 200.0;
}
public function markupInlineCodeBlock($matches) {
$engine = $this->getEngine();
$text = $matches[1];
$src = phutil_tag(
'img',
array(
'src' => $text
), '');
return $engine->storeText($src);
}
}
?>

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/r6/re/isj4unh22ptcsbiv
Default Alt Text
Bare_img_tag_support_in_remarkup,_like_P1129 (586 B)

Event Timeline