Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91175340
PhutilRemarkupDelRule.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
Fri, Nov 8, 16:12
Size
467 B
Mime Type
text/x-php
Expires
Sun, Nov 10, 16:12 (2 d)
Engine
blob
Format
Raw Data
Handle
22212566
Attached To
rPHU libphutil
PhutilRemarkupDelRule.php
View Options
<?php
final
class
PhutilRemarkupDelRule
extends
PhutilRemarkupRule
{
public
function
getPriority
()
{
return
1000.0
;
}
public
function
apply
(
$text
)
{
if
(
$this
->
getEngine
()->
isTextMode
())
{
return
$text
;
}
return
$this
->
replaceHTML
(
'@(?<!~)~~([^
\s
~].*?~*)~~@s'
,
array
(
$this
,
'applyCallback'
),
$text
);
}
protected
function
applyCallback
(
array
$matches
)
{
return
hsprintf
(
'<del>%s</del>'
,
$matches
[
1
]);
}
}
Event Timeline
Log In to Comment