Skip to content

Commit c002dc0

Browse files
authored
Merge pull request #678 from jrblevin/issue/346
Support negative exponent in superscript
2 parents 1d491a4 + 0568d6a commit c002dc0

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
- Auto set `sh-shell` when `markdown-edit-code-block` enter indirect buffer with `sh-mode`
4949
- Add value check and avoid raising the exception at `markdown-edit-code-block` [GH-663][]
5050
- Add NonGNU ELPA badge to README and website
51+
- Support negative exponent in super script [GH-346][]
5152

5253
* Bug fixes:
5354
- Fix issue with `nil` being returned from `markdown-imenu-create-nested-index` [GH-578][]
@@ -88,6 +89,7 @@
8889

8990
[gh-290]: https://github.com/jrblevin/markdown-mode/issues/290
9091
[gh-311]: https://github.com/jrblevin/markdown-mode/issues/311
92+
[gh-346]: https://github.com/jrblevin/markdown-mode/issues/346
9193
[gh-375]: https://github.com/jrblevin/markdown-mode/issues/375
9294
[gh-476]: https://github.com/jrblevin/markdown-mode/issues/476
9395
[gh-511]: https://github.com/jrblevin/markdown-mode/issues/511

markdown-mode.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ Compatible with Pandoc, Python Markdown, PHP Markdown Extra, and Leanpub.")
995995
"Regular expression for Leanpub section markers and related syntax.")
996996

997997
(defconst markdown-regex-sub-superscript
998-
"\\(?:^\\|[^\\~^]\\)\\(?1:\\(?2:[~^]\\)\\(?3:[[:alnum:]]+\\)\\(?4:\\2\\)\\)"
998+
"\\(?:^\\|[^\\~^]\\)\\(?1:\\(?2:[~^]\\)\\(?3:[-]?[[:alnum:]]+\\)\\(?4:\\2\\)\\)"
999999
"The regular expression matching a sub- or superscript.
10001000
The leading un-numbered group matches the character before the
10011001
opening tilde or carat, if any, ensuring that it is not a

tests/markdown-test.el

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3323,7 +3323,12 @@ takes precedence)."
33233323
(markdown-test-range-has-face 1 3 nil) ; 334
33243324
(markdown-test-range-has-face 4 4 'markdown-markup-face) ; First ^
33253325
(markdown-test-range-has-face 5 6 nil) ; 10
3326-
(markdown-test-range-has-face 7 7 'markdown-markup-face))) ; Second ^
3326+
(markdown-test-range-has-face 7 7 'markdown-markup-face)) ; Second ^
3327+
(markdown-test-string "1.0 x 10^-15^"
3328+
(markdown-test-range-has-face 1 8 nil)
3329+
(markdown-test-range-has-face 9 9 'markdown-markup-face)
3330+
(markdown-test-range-has-face 10 12 nil)
3331+
(markdown-test-range-has-face 13 13 'markdown-markup-face)))
33273332

33283333
(ert-deftest test-markdown-font-lock/hidden-urls-inline ()
33293334
"Test URL hiding and toggling."

0 commit comments

Comments
 (0)