Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93093036
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
Tue, Nov 26, 04:06
Size
910 B
Mime Type
text/x-php
Expires
Thu, Nov 28, 04:06 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22574270
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