Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F73627253
PhutilRemarkupRuleItalic.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
Tue, Jul 23, 07:10
Size
481 B
Mime Type
text/x-php
Expires
Thu, Jul 25, 07:10 (2 d)
Engine
blob
Format
Raw Data
Handle
19238480
Attached To
rPHU libphutil
PhutilRemarkupRuleItalic.php
View Options
<?php
/**
* @group markup
*/
final
class
PhutilRemarkupRuleItalic
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
(
$matches
)
{
return
hsprintf
(
'<em>%s</em>'
,
$matches
[
1
]);
}
}
Event Timeline
Log In to Comment