From 4547a6d17b664cc8a981d831c69ba8a916c504c5 Mon Sep 17 00:00:00 2001 From: ikkez Date: Sun, 23 Jul 2023 23:54:49 +0200 Subject: [PATCH] fix #363: unicode chars not captured correctly for headline slugs --- markdown.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/markdown.php b/markdown.php index 4be4c561..cb03d148 100644 --- a/markdown.php +++ b/markdown.php @@ -467,8 +467,8 @@ protected function build($str) { 'fence'=>'/^`{3}\h*(\w+)?.*?[^\n]*\n+(.+?)`{3}[^\n]*'. '(?:\n+|$)/s', 'hr'=>'/^\h*[*_\-](?:\h?[\*_\-]){2,}\h*(?:\n+|$)/', - 'atx'=>'/^\h*(#{1,6})\h?(.+?)\h*(?:#.*)?(?:\n+|$)/', - 'setext'=>'/^\h*(.+?)\h*\n([=\-])+\h*(?:\n+|$)/', + 'atx'=>'/^\h*(#{1,6})\h?(.+?)\h*(?:#.*)?(?:\n+|$)/u', + 'setext'=>'/^\h*(.+?)\h*\n([=\-])+\h*(?:\n+|$)/u', 'li'=>'/^(?:(?:[*+\-]|\d+\.)\h.+?(?:\n+|$)'. '(?:(?: {4}|\t)+.+?(?:\n+|$))*)+/s', 'raw'=>'/^((?:|'.