Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P1271
Bare img tag support in remarkup, like P1129
Active
Public
Actions
Authored by
bougyman
on Oct 2 2014, 7:12 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Subscribers
None
<?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
);
}
}
?>
Event Timeline
bougyman
edited the content of this paste.
(Show Details)
Oct 2 2014, 7:12 PM
bougyman
changed the title of this paste from untitled to
Bare img tag support in remarkup, like P1129
.
bougyman
updated the paste's language from
autodetect
to
autodetect
.
Comment Actions
Relates to
P1129
and
T4190
Log In to Comment