Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F108349531
PhutilRemarkupDefaultBlockRule.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, Apr 16, 02:21
Size
760 B
Mime Type
text/x-php
Expires
Fri, Apr 18, 02:21 (2 d)
Engine
blob
Format
Raw Data
Handle
25582511
Attached To
rPHU libphutil
PhutilRemarkupDefaultBlockRule.php
View Options
<?php
final
class
PhutilRemarkupDefaultBlockRule
extends
PhutilRemarkupBlockRule
{
public
function
getPriority
()
{
return
750
;
}
public
function
getMatchingLineCount
(
array
$lines
,
$cursor
)
{
return
1
;
}
public
function
markupText
(
$text
,
$children
)
{
$text
=
trim
(
$text
);
$text
=
$this
->
applyRules
(
$text
);
if
(
$this
->
getEngine
()->
isTextMode
())
{
if
(!
$this
->
getEngine
()->
getConfig
(
'preserve-linebreaks'
))
{
$text
=
preg_replace
(
'/ *
\n
*/'
,
' '
,
$text
);
}
return
$text
;
}
if
(
$this
->
getEngine
()->
getConfig
(
'preserve-linebreaks'
))
{
$text
=
phutil_escape_html_newlines
(
$text
);
}
if
(!
strlen
(
$text
))
{
return
null
;
}
return
phutil_tag
(
'p'
,
array
(),
$text
);
}
}
Event Timeline
Log In to Comment