mirror of
https://github.com/erusev/parsedown.git
synced 2024-09-19 19:41:29 +02:00
Added tests for horizontal rules and fixed underscore rules
This commit is contained in:
parent
8ed3b3d484
commit
c65297307f
@ -252,15 +252,6 @@ class Parsedown
|
||||
continue;
|
||||
}
|
||||
|
||||
# Horizontal Line
|
||||
|
||||
if (isset($block) and preg_match('/^[ ]{0,3}([-*_])([ ]{0,2}\1){2,}$/', $block))
|
||||
{
|
||||
$markup .= '<hr />'."\n";
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
# ~
|
||||
|
||||
if (isset($quick_block))
|
||||
@ -270,6 +261,18 @@ class Parsedown
|
||||
unset ($quick_block);
|
||||
}
|
||||
|
||||
# Horizontal Line
|
||||
# Horizontal lines checks could be optimized with $quick_block
|
||||
# But '_' > 'A' and horizontal lines could be defined by underscores
|
||||
# See #13
|
||||
|
||||
if (isset($block) and preg_match('/^[ ]{0,3}([-*_])([ ]{0,2}\1){2,}$/', $block))
|
||||
{
|
||||
$markup .= '<hr />'."\n";
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
#
|
||||
# Paragraph
|
||||
|
||||
|
6
tests/data/horizontal_line.html
Normal file
6
tests/data/horizontal_line.html
Normal file
@ -0,0 +1,6 @@
|
||||
<p>Horizontal line with dashes</p>
|
||||
<hr />
|
||||
<p>Horizontal line with asterisks</p>
|
||||
<hr />
|
||||
<p>Horizontal line with underscores</p>
|
||||
<hr />
|
11
tests/data/horizontal_line.md
Normal file
11
tests/data/horizontal_line.md
Normal file
@ -0,0 +1,11 @@
|
||||
Horizontal line with dashes
|
||||
|
||||
---
|
||||
|
||||
Horizontal line with asterisks
|
||||
|
||||
***
|
||||
|
||||
Horizontal line with underscores
|
||||
|
||||
___
|
Loading…
Reference in New Issue
Block a user