Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F211841
Bare_img_tag_support_in_remarkup,_like_P1129
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
bougyman
Oct 2 2014, 7:12 PM
2014-10-02 19:12:42 (UTC+0)
Size
586 B
Referenced Files
None
Subscribers
None
Bare_img_tag_support_in_remarkup,_like_P1129
View Options
<?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
Details
Attached
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)
Attached To
Mode
P1271 Bare img tag support in remarkup, like P1129
Attached
Detach File
Event Timeline
Log In to Comment