emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/markdown-mode c002dc0753 2/2: Merge pull request #678 from


From: ELPA Syncer
Subject: [nongnu] elpa/markdown-mode c002dc0753 2/2: Merge pull request #678 from jrblevin/issue/346
Date: Mon, 17 Jan 2022 09:58:07 -0500 (EST)

branch: elpa/markdown-mode
commit c002dc075397143147b5660df289d834d06b5909
Merge: 1d491a4ba0 0568d6ac14
Author: Shohei YOSHIDA <syohex@gmail.com>
Commit: GitHub <noreply@github.com>

    Merge pull request #678 from jrblevin/issue/346
    
    Support negative exponent in superscript
---
 CHANGES.md             | 2 ++
 markdown-mode.el       | 2 +-
 tests/markdown-test.el | 7 ++++++-
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/CHANGES.md b/CHANGES.md
index 26deecf42e..6c47dfc9f8 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -48,6 +48,7 @@
     -   Auto set `sh-shell` when `markdown-edit-code-block` enter indirect 
buffer with `sh-mode`
     -   Add value check and avoid raising the exception at 
`markdown-edit-code-block` [GH-663][]
     -   Add NonGNU ELPA badge to README and website
+    -   Support negative exponent in super script [GH-346][]
 
 *   Bug fixes:
     -   Fix issue with `nil` being returned from 
`markdown-imenu-create-nested-index` [GH-578][]
@@ -88,6 +89,7 @@
 
   [gh-290]: https://github.com/jrblevin/markdown-mode/issues/290
   [gh-311]: https://github.com/jrblevin/markdown-mode/issues/311
+  [gh-346]: https://github.com/jrblevin/markdown-mode/issues/346
   [gh-375]: https://github.com/jrblevin/markdown-mode/issues/375
   [gh-476]: https://github.com/jrblevin/markdown-mode/issues/476
   [gh-511]: https://github.com/jrblevin/markdown-mode/issues/511
diff --git a/markdown-mode.el b/markdown-mode.el
index 303d9f2ffc..dc2d319fc4 100644
--- a/markdown-mode.el
+++ b/markdown-mode.el
@@ -995,7 +995,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:[-]?[[:alnum:]]+\\)\\(?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
diff --git a/tests/markdown-test.el b/tests/markdown-test.el
index cf60868878..fcf7d53118 100644
--- a/tests/markdown-test.el
+++ b/tests/markdown-test.el
@@ -3323,7 +3323,12 @@ takes precedence)."
     (markdown-test-range-has-face 1 3 nil) ; 334
     (markdown-test-range-has-face 4 4 'markdown-markup-face) ; First ^
     (markdown-test-range-has-face 5 6 nil) ; 10
-    (markdown-test-range-has-face 7 7 'markdown-markup-face))) ; Second ^
+    (markdown-test-range-has-face 7 7 'markdown-markup-face)) ; Second ^
+  (markdown-test-string "1.0 x 10^-15^"
+    (markdown-test-range-has-face 1 8 nil)
+    (markdown-test-range-has-face 9 9 'markdown-markup-face)
+    (markdown-test-range-has-face 10 12 nil)
+    (markdown-test-range-has-face 13 13 'markdown-markup-face)))
 
 (ert-deftest test-markdown-font-lock/hidden-urls-inline ()
   "Test URL hiding and toggling."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]