From 6cd3765a1d60b6557b9f083b4218fe00287a9329 Mon Sep 17 00:00:00 2001 From: facelessuser Date: Fri, 4 Sep 2015 19:45:44 -0600 Subject: Fix infinite loop #430 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This should fix the remaining corner cases that can cause infinite loops. Previous iterations did not account for scenarios where the “end” index was less than the “start” index. If the “end” index is ever less than or equal to the “start” index, the “end” will be adjusted to to be “start” + 1 allow the full range to be extracted and replaced. --- tests/extensions/extra/raw-html.html | 7 ++++++- tests/extensions/extra/raw-html.txt | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'tests/extensions/extra') diff --git a/tests/extensions/extra/raw-html.html b/tests/extensions/extra/raw-html.html index 7acb2ee..9c0222f 100644 --- a/tests/extensions/extra/raw-html.html +++ b/tests/extensions/extra/raw-html.html @@ -41,4 +41,9 @@ Raw html blocks may also be nested.

Markdown is still active here.

-

Markdown is active again here.

\ No newline at end of file +

Markdown is active again here.

+
+

foo bar

+

bar +

+
\ No newline at end of file diff --git a/tests/extensions/extra/raw-html.txt b/tests/extensions/extra/raw-html.txt index 72f530b..da24af0 100644 --- a/tests/extensions/extra/raw-html.txt +++ b/tests/extensions/extra/raw-html.txt @@ -65,3 +65,9 @@ Markdown is *still* active here. Markdown is *active again* here. + +
+foo bar + +bar +
-- cgit v1.2.3