Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F62205887
PhutilRemarkupEngineRemarkupHorizontalRuleBlockRule.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
Sat, May 11, 15:11
Size
639 B
Mime Type
text/x-php
Expires
Mon, May 13, 15:11 (2 d)
Engine
blob
Format
Raw Data
Handle
17618859
Attached To
rPHU libphutil
PhutilRemarkupEngineRemarkupHorizontalRuleBlockRule.php
View Options
<?php
/**
* @group markup
*/
final
class
PhutilRemarkupEngineRemarkupHorizontalRuleBlockRule
extends
PhutilRemarkupEngineBlockRule
{
public
function
getMatchingLineCount
(
array
$lines
,
$cursor
)
{
$num_lines
=
0
;
$pattern
=
"/^_{3,}$|^
\*\s
?
\*\s
?
\*
(
\s
|
\*
)*$|^
\-\s
?
\-\s
?
\-
(
\s
|
\-
)*$/"
;
if
(
preg_match
(
$pattern
,
rtrim
(
$lines
[
$cursor
],
"
\n\r
"
)))
{
$num_lines
++;
$cursor
++;
while
(
isset
(
$lines
[
$cursor
])
&&
!
strlen
(
trim
(
$lines
[
$cursor
])))
{
$num_lines
++;
$cursor
++;
}
}
return
$num_lines
;
}
public
function
markupText
(
$text
)
{
return
phutil_tag
(
'hr'
,
array
());
}
}
Event Timeline
Log In to Comment