From fc37ad11ed6c3dd6eee355907a8a3a1d81be58ad Mon Sep 17 00:00:00 2001
From: Aidan Woods
Date: Tue, 22 Jan 2019 19:28:12 +0000
Subject: [PATCH] Tabs shouldn't break thematic breaks
---
src/Components/Blocks/Rule.php | 5 ++++-
tests/data/horizontal_rule.html | 3 ++-
tests/data/horizontal_rule.md | 4 +++-
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/Components/Blocks/Rule.php b/src/Components/Blocks/Rule.php
index a6a88e3..218b015 100644
--- a/src/Components/Blocks/Rule.php
+++ b/src/Components/Blocks/Rule.php
@@ -30,7 +30,10 @@ final class Rule implements Block
$marker = $Context->line()->text()[0];
- if (\substr_count($Context->line()->text(), $marker) >= 3 and \chop($Context->line()->text(), " $marker") === '') {
+ if (
+ \substr_count($Context->line()->text(), $marker) >= 3
+ and \chop($Context->line()->text(), " \t$marker") === ''
+ ) {
return new self;
}
diff --git a/tests/data/horizontal_rule.html b/tests/data/horizontal_rule.html
index 4d3f44f..b8d1249 100644
--- a/tests/data/horizontal_rule.html
+++ b/tests/data/horizontal_rule.html
@@ -4,4 +4,5 @@
foo
-***
\ No newline at end of file
+***
+
\ No newline at end of file
diff --git a/tests/data/horizontal_rule.md b/tests/data/horizontal_rule.md
index 9a1bb57..f818593 100644
--- a/tests/data/horizontal_rule.md
+++ b/tests/data/horizontal_rule.md
@@ -9,4 +9,6 @@
___
foo
- ***
\ No newline at end of file
+ ***
+
+* * *
\ No newline at end of file