Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2892989
PhutilRemarkupUnderlineRule.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
482 B
Referenced Files
None
Subscribers
None
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
]
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Jan 19 2025, 17:40 (6 w, 9 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1127061
Default Alt Text
PhutilRemarkupUnderlineRule.php (482 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment