Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90887909
PhutilRemarkupRuleUnderline.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, Nov 5, 16:40
Size
478 B
Mime Type
text/x-php
Expires
Thu, Nov 7, 16:40 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22153136
Attached To
rPHU libphutil
PhutilRemarkupRuleUnderline.php
View Options
<?php
final
class
PhutilRemarkupRuleUnderline
extends
PhutilRemarkupRule
{
public
function
getPriority
()
{
return
1000.0
;
}
public
function
apply
(
$text
)
{
if
(
$this
->
getEngine
()->
isTextMode
())
{
return
$text
;
}
return
$this
->
replaceHTML
(
'@(?<!_|/)__([^
\s
_/].*?_*)__(?!/|
\.\S
)@s'
,
array
(
$this
,
'applyCallback'
),
$text
);
}
protected
function
applyCallback
(
$matches
)
{
return
hsprintf
(
'<u>%s</u>'
,
$matches
[
1
]);
}
}
Event Timeline
Log In to Comment