From b24942271e8668eaeb40e793d7c82be7a5822f19 Mon Sep 17 00:00:00 2001 From: Dmitry Safronov Date: Wed, 12 Aug 2020 12:16:37 +0200 Subject: [PATCH 1/2] Improve fontification of sub- and superscript --- markdown-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/markdown-mode.el b/markdown-mode.el index 33fee71f..18edf05a 100644 --- a/markdown-mode.el +++ b/markdown-mode.el @@ -953,7 +953,7 @@ Compatible with Pandoc, Python Markdown, PHP Markdown Extra, and Leanpub.") "Regular expression for Leanpub section markers and related syntax.") (defconst markdown-regex-sub-superscript - "\\(?:^\\|[^\\~^]\\)\\(?1:\\(?2:[~^]\\)\\(?3:[[:alnum:]]+\\)\\(?4:\\2\\)\\)" + "\\(?:^\\|[^\\~^]\\)\\(?1:\\(?2:[~^]\\)\\(?3:\\(?:\\\\.\\|[^[:space:]]\\)+\\)\\(?4:\\2\\)\\)" "The regular expression matching a sub- or superscript. The leading un-numbered group matches the character before the opening tilde or carat, if any, ensuring that it is not a From 4c748b32ec227a60a3e52b7ba21fd70e663147cb Mon Sep 17 00:00:00 2001 From: Dmitry Safronov Date: Thu, 13 Aug 2020 10:55:17 +0200 Subject: [PATCH 2/2] Fix regex for sub- and superscript detection --- markdown-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/markdown-mode.el b/markdown-mode.el index 18edf05a..65909aeb 100644 --- a/markdown-mode.el +++ b/markdown-mode.el @@ -953,7 +953,7 @@ Compatible with Pandoc, Python Markdown, PHP Markdown Extra, and Leanpub.") "Regular expression for Leanpub section markers and related syntax.") (defconst markdown-regex-sub-superscript - "\\(?:^\\|[^\\~^]\\)\\(?1:\\(?2:[~^]\\)\\(?3:\\(?:\\\\.\\|[^[:space:]]\\)+\\)\\(?4:\\2\\)\\)" + "\\(?:^\\|[^\\~^]\\)\\(?1:\\(?2:[~^]\\)\\(?3:\\(?:\\\\.\\|[^[:space:]]\\)+?\\)\\(?4:\\2\\)\\)" "The regular expression matching a sub- or superscript. The leading un-numbered group matches the character before the opening tilde or carat, if any, ensuring that it is not a