Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F95702776
PhutilRemarkupUnderlineRule.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
Wed, Dec 18, 12:51
Size
476 B
Mime Type
text/x-php
Expires
Fri, Dec 20, 12:51 (2 d)
Engine
blob
Format
Raw Data
Handle
23043685
Attached To
rPHU libphutil
PhutilRemarkupUnderlineRule.php
View Options
<?php
final
class
PhutilRemarkupUnderlineRule
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