Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F100490793
PhutilRemarkupQuotesBlockRule.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
Fri, Jan 31, 05:27
Size
910 B
Mime Type
text/x-php
Expires
Sun, Feb 2, 05:27 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23975663
Attached To
rPHU libphutil
PhutilRemarkupQuotesBlockRule.php
View Options
<?php
final
class
PhutilRemarkupQuotesBlockRule
extends
PhutilRemarkupBlockRule
{
public
function
getMatchingLineCount
(
array
$lines
,
$cursor
)
{
$pos
=
$cursor
;
if
(
preg_match
(
'/^>/'
,
$lines
[
$pos
]))
{
do
{
++
$pos
;
}
while
(
isset
(
$lines
[
$pos
])
&&
preg_match
(
'/^>/'
,
$lines
[
$pos
]));
}
return
(
$pos
-
$cursor
);
}
public
function
supportsChildBlocks
()
{
return
true
;
}
public
function
extractChildText
(
$text
)
{
$text
=
phutil_split_lines
(
$text
,
true
);
foreach
(
$text
as
$key
=>
$line
)
{
$text
[
$key
]
=
substr
(
$line
,
1
);
}
return
array
(
''
,
implode
(
''
,
$text
));
}
public
function
markupText
(
$text
,
$children
)
{
if
(
$this
->
getEngine
()->
isTextMode
())
{
$lines
=
phutil_split_lines
(
$children
);
return
'> '
.
implode
(
"
\n
> "
,
$lines
);
}
return
phutil_tag
(
'blockquote'
,
array
(),
$children
);
}
}
Event Timeline
Log In to Comment