Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F98618216
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
Tue, Jan 14, 22:57
Size
482 B
Mime Type
text/x-php
Expires
Thu, Jan 16, 22:57 (2 d)
Engine
blob
Format
Raw Data
Handle
23611950
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
(
array
$matches
)
{
return
hsprintf
(
'<u>%s</u>'
,
$matches
[
1
]);
}
}
Event Timeline
Log In to Comment