branch: elpa/markdown-mode
commit 9de2df5a9f2f864c82ec112d3369154767a2bb49
Merge: 92802fae9eb c530b42cc2d
Author: Shohei YOSHIDA <[email protected]>
Commit: GitHub <[email protected]>
Merge pull request #927 from jrblevin/issue-926
Change fontifying orders and fix strike-through highlightings
---
CHANGES.md | 2 ++
markdown-mode.el | 6 +++---
tests/markdown-test.el | 8 ++++++++
3 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/CHANGES.md b/CHANGES.md
index 7ab0e180683..3413dad0732 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -19,6 +19,7 @@
- Catch an exception when `scan-sexp` fails [GH-917][]
- `markdown-link-at-pos` should decode both control characters and spaces
[GH-921][]
- `markdown-table-align` now aligns centered cells
+ - Fix highlightings of inline code or bold in strike-through [GH-926][]
* Improvements:
- Support drag and drop features on Windows and multiple files' drag and
drop
@@ -37,6 +38,7 @@
[gh-912]: https://github.com/jrblevin/markdown-mode/issues/912
[gh-917]: https://github.com/jrblevin/markdown-mode/issues/917
[gh-921]: https://github.com/jrblevin/markdown-mode/issues/921
+ [gh-926]: https://github.com/jrblevin/markdown-mode/issues/926
# Markdown Mode 2.7
diff --git a/markdown-mode.el b/markdown-mode.el
index 8be1daafd13..ddeaf7bd16a 100644
--- a/markdown-mode.el
+++ b/markdown-mode.el
@@ -2254,6 +2254,9 @@ Depending on your font, some reasonable choices are:
(2 'markdown-markup-face)
(3 'markdown-metadata-value-face)))
(markdown-fontify-hrs)
+ (,markdown-regex-strike-through . ((3 markdown-markup-properties)
+ (4 'markdown-strike-through-face)
+ (5 markdown-markup-properties)))
(markdown-match-code . ((1 markdown-markup-properties prepend)
(2 'markdown-inline-code-face prepend)
(3 markdown-markup-properties prepend)))
@@ -2319,9 +2322,6 @@ Depending on your font, some reasonable choices are:
(markdown-match-italic . ((1 markdown-markup-properties prepend)
(2 'markdown-italic-face append)
(3 markdown-markup-properties prepend)))
- (,markdown-regex-strike-through . ((3 markdown-markup-properties)
- (4 'markdown-strike-through-face)
- (5 markdown-markup-properties)))
(markdown--match-highlighting . ((3 markdown-markup-properties)
(4 'markdown-highlighting-face)
(5 markdown-markup-properties)))
diff --git a/tests/markdown-test.el b/tests/markdown-test.el
index ed2dfaba871..f70be1d46bc 100644
--- a/tests/markdown-test.el
+++ b/tests/markdown-test.el
@@ -6958,6 +6958,14 @@ Details:
https://github.com/jrblevin/markdown-mode/issues/534"
(markdown-test-range-has-face 10 11 'markdown-markup-face)
(markdown-test-range-has-face 12 17 nil)))
+(ert-deftest test-markdown-gfm/strike-through-with-inline-code ()
+ "Test strike-throughts with inline code.
+Details: https://github.com/jrblevin/markdown-mode/issues/926"
+ (markdown-test-string-gfm "~~nested `code` in strike-through~~"
+ (markdown-test-range-has-face 1 2 'markdown-markup-face)
+ (markdown-test-range-has-face 3 33 'markdown-strike-through-face)
+ (markdown-test-range-has-face 11 14 'markdown-inline-code-face)))
+
(ert-deftest test-markdown-gfm/insert-strike-through ()
"Test `markdown-insert-strike-through'."
(markdown-test-string-gfm "one two three"