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

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

[nongnu] elpa/markdown-mode 74aa058 1/2: Fix consecutive HTML comments h


From: ELPA Syncer
Subject: [nongnu] elpa/markdown-mode 74aa058 1/2: Fix consecutive HTML comments highlighting issue
Date: Tue, 12 Jan 2021 11:57:09 -0500 (EST)

branch: elpa/markdown-mode
commit 74aa0582f499add5c6796207f4255e9aae6ad312
Author: Shohei YOSHIDA <syohex@gmail.com>
Commit: Shohei YOSHIDA <syohex@gmail.com>

    Fix consecutive HTML comments highlighting issue
---
 CHANGES.md             | 2 ++
 markdown-mode.el       | 2 +-
 tests/markdown-test.el | 8 ++++++++
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/CHANGES.md b/CHANGES.md
index d3ed601..1fe76f8 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -37,6 +37,7 @@
     -   Fix wrong italic fontification just after code block [GH-548][]
     -   Fix too indended list face issue [GH-569][]
     -   Fix creating imenu index issue when there is no level-1 header 
too[GH-571][]
+    -   Fix highlighting consecutive HTML comments[GH-584][]
 
   [gh-290]: https://github.com/jrblevin/markdown-mode/issues/290
   [gh-311]: https://github.com/jrblevin/markdown-mode/issues/311
@@ -58,6 +59,7 @@
   [gh-560]: https://github.com/jrblevin/markdown-mode/issues/560
   [gh-569]: https://github.com/jrblevin/markdown-mode/issues/569
   [gh-571]: https://github.com/jrblevin/markdown-mode/issues/571
+  [gh-584]: https://github.com/jrblevin/markdown-mode/issues/584
 
 # Markdown Mode 2.4
 
diff --git a/markdown-mode.el b/markdown-mode.el
index d784b98..542de4e 100644
--- a/markdown-mode.el
+++ b/markdown-mode.el
@@ -1668,7 +1668,7 @@ region of a YAML metadata block as propertized by
                                     markdown--syntax-properties)
             (put-text-property comment-begin comment-end
                                'markdown-comment (list comment-begin 
comment-end))
-            (goto-char (min (1+ comment-end) end (point-max)))))
+            (goto-char (min comment-end end (point-max)))))
          ;; Nothing found
          (t (setq finish t)))))
     nil))
diff --git a/tests/markdown-test.el b/tests/markdown-test.el
index a6b200f..6d072b0 100644
--- a/tests/markdown-test.el
+++ b/tests/markdown-test.el
@@ -2618,6 +2618,14 @@ Test currently fails because this case isn't handled 
properly."
    (markdown-test-range-has-face 1 19 'markdown-comment-face)
    (should-not (markdown-range-property-any 1 19 'face 
'(markdown-inline-code-face)))))
 
+(ert-deftest test-markdown-font-lock/consecutive-html-comments ()
+  "Test for consecutive HTML comments.
+Detail: https://github.com/jrblevin/markdown-mode/issues/584";
+  (markdown-test-string
+   "Main text <!--a comment--><!--another comment-->."
+   (markdown-test-range-has-face 11 26 'markdown-comment-face)
+   (markdown-test-range-has-face 27 28 'markdown-comment-face)))
+
 (ert-deftest test-markdown-font-lock/kbd ()
   "Test font lock for <kbd> tags."
   (markdown-test-string "<kbd>C-c <</kbd>"



reply via email to

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