From e74a5bd7ed8ac3eaf0e95bca6d1096bdbad6bd4f Mon Sep 17 00:00:00 2001 From: Aidan Woods Date: Mon, 9 Apr 2018 01:46:36 +0100 Subject: [PATCH] In theory PHP stores the length of strings, so looking this up should be quick --- Parsedown.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Parsedown.php b/Parsedown.php index 794438a..a973478 100644 --- a/Parsedown.php +++ b/Parsedown.php @@ -1102,7 +1102,7 @@ class Parsedown { $marker = $excerpt[0]; - $markerPosition = strpos($text, $marker); + $markerPosition = strlen($text) - strlen($excerpt); $Excerpt = array('text' => $excerpt, 'context' => $text);