Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90771870
PhutilRemarkupRuleBold.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
Mon, Nov 4, 14:54
Size
489 B
Mime Type
text/x-php
Expires
Wed, Nov 6, 14:54 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22127033
Attached To
rPHU libphutil
PhutilRemarkupRuleBold.php
View Options
<?php
/**
* @group markup
*/
final
class
PhutilRemarkupRuleBold
extends
PhutilRemarkupRule
{
public
function
getPriority
()
{
return
1000.0
;
}
public
function
apply
(
$text
)
{
if
(
$this
->
getEngine
()->
isTextMode
())
{
return
$text
;
}
return
$this
->
replaceHTML
(
'@
\\
*
\\
*(.+?)
\\
*
\\
*@s'
,
array
(
$this
,
'applyCallback'
),
$text
);
}
protected
function
applyCallback
(
$matches
)
{
return
hsprintf
(
'<strong>%s</strong>'
,
$matches
[
1
]);
}
}
Event Timeline
Log In to Comment