Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F472046
PhutilRemarkupDefaultBlockRule.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
968 B
Referenced Files
None
Subscribers
None
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
)
{
$engine
=
$this
->
getEngine
();
$text
=
trim
(
$text
);
$text
=
$this
->
applyRules
(
$text
);
if
(
$engine
->
isTextMode
())
{
if
(!
$this
->
getEngine
()->
getConfig
(
'preserve-linebreaks'
))
{
$text
=
preg_replace
(
'/ *
\n
*/'
,
' '
,
$text
);
}
return
$text
;
}
if
(
$engine
->
getConfig
(
'preserve-linebreaks'
))
{
$text
=
phutil_escape_html_newlines
(
$text
);
}
if
(!
strlen
(
$text
))
{
return
null
;
}
$default_attributes
=
$engine
->
getConfig
(
'default.p.attributes'
);
if
(
$default_attributes
)
{
$attributes
=
$default_attributes
;
}
else
{
$attributes
=
array
();
}
return
phutil_tag
(
'p'
,
$attributes
,
$text
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, May 6, 4:04 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
83261
Default Alt Text
PhutilRemarkupDefaultBlockRule.php (968 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment