Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96570023
PhutilRemarkupItalicRule.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Dec 28, 07:11
Size
460 B
Mime Type
text/x-php
Expires
Mon, Dec 30, 07:11 (2 d)
Engine
blob
Format
Raw Data
Handle
23208709
Attached To
rPHU libphutil
PhutilRemarkupItalicRule.php
View Options
<?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
]);
}
}
Event Timeline
Log In to Comment