Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102050831
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
Sun, Feb 16, 14:48
Size
785 B
Mime Type
text/x-php
Expires
Tue, Feb 18, 14:48 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24270959
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