Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F110907725
PhutilRemarkupLiteralBlockRule.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, Apr 28, 18:17
Size
785 B
Mime Type
text/x-php
Expires
Wed, Apr 30, 18:17 (2 d)
Engine
blob
Format
Raw Data
Handle
25820028
Attached To
rPHU libphutil
PhutilRemarkupLiteralBlockRule.php
View Options
<?php
final
class
PhutilRemarkupLiteralBlockRule
extends
PhutilRemarkupBlockRule
{
public
function
getMatchingLineCount
(
array
$lines
,
$cursor
)
{
$num_lines
=
0
;
if
(
preg_match
(
'/^%%%/'
,
$lines
[
$cursor
]))
{
$num_lines
++;
while
(
isset
(
$lines
[
$cursor
]))
{
if
(!
preg_match
(
'/%%%
\s
*$/'
,
$lines
[
$cursor
]))
{
$num_lines
++;
$cursor
++;
continue
;
}
break
;
}
}
return
$num_lines
;
}
public
function
markupText
(
$text
,
$children
)
{
$text
=
preg_replace
(
'/%%%
\s
*$/'
,
''
,
substr
(
$text
,
3
));
if
(
$this
->
getEngine
()->
isTextMode
())
{
return
$text
;
}
$text
=
phutil_split_lines
(
$text
,
$retain_endings
=
true
);
return
phutil_implode_html
(
phutil_tag
(
'br'
,
array
()),
$text
);
}
}
Event Timeline
Log In to Comment