branch: elpa/markdown-mode
commit 77cf39603f1094e5492ca1603a89714b7f30c645
Author: Shohei YOSHIDA <syo...@gmail.com>
Commit: Shohei YOSHIDA <syo...@gmail.com>

    Fix angle URL fontification issue
---
 CHANGES.md             |  3 +++
 markdown-mode.el       | 11 ++++++-----
 tests/markdown-test.el |  7 +++++++
 3 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/CHANGES.md b/CHANGES.md
index 38b24bfa5f..aeaceeecee 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -12,6 +12,7 @@
 *   Bug fixes:
     - `markdown-export` should not output stderr content to output file
     - Hide wikilink markup as part of `markdown-toggle-markup-hiding` 
[GH-847][]
+    - Angle URL fontify issue which was introduced by [GH-861][] [GH-895][]
 
 *   Improvements:
     - Support drag and drop features on Windows and multiple files' drag and 
drop
@@ -19,8 +20,10 @@
     - Disable `imenu-submenus-on-top` by default [GH-882][]
 
   [gh-847]: https://github.com/jrblevin/markdown-mode/issues/847
+  [gh-861]: https://github.com/jrblevin/markdown-mode/pull/861
   [gh-882]: https://github.com/jrblevin/markdown-mode/issues/882
   [gh-891]: https://github.com/jrblevin/markdown-mode/issues/891
+  [gh-895]: https://github.com/jrblevin/markdown-mode/issues/895
 
 # Markdown Mode 2.7
 
diff --git a/markdown-mode.el b/markdown-mode.el
index 6987741a5b..fc1796b344 100644
--- a/markdown-mode.el
+++ b/markdown-mode.el
@@ -8383,14 +8383,15 @@ Translate filenames using 
`markdown-filename-translate-function'."
           (url-end (match-end 2)))
       (unless (or (markdown-in-inline-code-p url-start)
                   (markdown-in-inline-code-p url-end))
-        (let* (;; URI part
-               (up (list 'keymap markdown-mode-mouse-map
-                         'face 'markdown-plain-url-face
-                         'font-lock-multiline t)))
+        (let ((mp (append '(face markdown-markup-face) (cl-copy-list 
markdown--markup-props)))
+              ;; URI part
+              (up (list 'keymap markdown-mode-mouse-map
+                        'face 'markdown-plain-url-face
+                        'font-lock-multiline t)))
           (when markdown-mouse-follow-link
             (setq up (append up '(mouse-face markdown-highlight-face))))
           (dolist (g '(1 3))
-            (add-text-properties (match-beginning g) (match-end g) 
markdown--markup-props))
+            (add-text-properties (match-beginning g) (match-end g) mp))
           (add-text-properties url-start url-end up)
           t)))))
 
diff --git a/tests/markdown-test.el b/tests/markdown-test.el
index 79b8831552..fdf23e3e89 100644
--- a/tests/markdown-test.el
+++ b/tests/markdown-test.el
@@ -2401,6 +2401,13 @@ Detail: 
https://github.com/jrblevin/markdown-mode/pull/674";
       "[cd\\_z\\_path.m](http://jblevins.org/research/centroid/cd_z_path.m)"
     (markdown-test-range-face-equals 17 65 'markdown-url-face)))
 
+(ert-deftest test-markdown-font-lock/angle-url ()
+  "Test URL highlighting with comma and parenthesis.
+Detail: https://github.com/jrblevin/markdown-mode/issues/895";
+  (markdown-test-string "<https://github.com/jonathanchu/atom-one-dark-theme>"
+    (markdown-test-range-has-face 1 1 'markdown-markup-face)
+    (markdown-test-range-has-face 52 52 'markdown-markup-face)))
+
 (ert-deftest test-markdown-font-lock/url-face-with-comma-and-parenthesis ()
   "Test URL highlighting with comma and parenthesis.
 Detail: https://github.com/jrblevin/markdown-mode/issues/649";

Reply via email to