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

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

[nongnu] elpa/markdown-mode ba8de41d86 3/3: Merge pull request #675 from


From: ELPA Syncer
Subject: [nongnu] elpa/markdown-mode ba8de41d86 3/3: Merge pull request #675 from jrblevin/pr-674
Date: Mon, 10 Jan 2022 07:58:36 -0500 (EST)

branch: elpa/markdown-mode
commit ba8de41d861ea0947f2585429b4ca39917683e35
Merge: 4469553a73 cba711a779
Author: Shohei YOSHIDA <syohex@gmail.com>
Commit: GitHub <noreply@github.com>

    Merge pull request #675 from jrblevin/pr-674
    
    Add unit test of #674
---
 CHANGES.md             |  3 +++
 markdown-mode.el       |  9 ++++-----
 tests/markdown-test.el | 12 ++++++++++++
 3 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/CHANGES.md b/CHANGES.md
index c1a7f7c776..f4330da19c 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -81,6 +81,8 @@
     -   Fix fill paragraph issue with setext heading [GH-638][]
     -   Fix line break highlighting issue at end of buffer [GH-621][]
     -   Fix URL highlighting which contains comma or parentheis [GH-649][]
+    -   Fix eldoc function issue with `markdown-toggle-url-hiding  [GH-674][]
+        Thanks to Ta Quang Trung for a patch
 
   [gh-290]: https://github.com/jrblevin/markdown-mode/issues/290
   [gh-311]: https://github.com/jrblevin/markdown-mode/issues/311
@@ -121,6 +123,7 @@
   [gh-652]: https://github.com/jrblevin/markdown-mode/issues/652
   [gh-663]: https://github.com/jrblevin/markdown-mode/issues/663
   [gh-666]: https://github.com/jrblevin/markdown-mode/issues/666
+  [gh-674]: https://github.com/jrblevin/markdown-mode/pull/674
 
 # Markdown Mode 2.4
 
diff --git a/markdown-mode.el b/markdown-mode.el
index 2dc3a97fe5..a4d08fd106 100644
--- a/markdown-mode.el
+++ b/markdown-mode.el
@@ -9645,22 +9645,21 @@ rows and columns and the column alignment."
              (thing-at-point-looking-at markdown-regex-link-reference))
          (or markdown-hide-urls markdown-hide-markup))
     (let* ((imagep (string-equal (match-string 1) "!"))
+           (referencep (string-equal (match-string 5) "["))
+           (link (match-string-no-properties 6))
            (edit-keys (markdown--substitute-command-keys
                        (if imagep
                            "\\[markdown-insert-image]"
                          "\\[markdown-insert-link]")))
            (edit-str (propertize edit-keys 'face 'font-lock-constant-face))
-           (referencep (string-equal (match-string 5) "["))
            (object (if referencep "reference" "URL")))
       (format "Hidden %s (%s to edit): %s" object edit-str
               (if referencep
                   (concat
                    (propertize "[" 'face 'markdown-markup-face)
-                   (propertize (match-string-no-properties 6)
-                               'face 'markdown-reference-face)
+                   (propertize link 'face 'markdown-reference-face)
                    (propertize "]" 'face 'markdown-markup-face))
-                (propertize (match-string-no-properties 6)
-                            'face 'markdown-url-face)))))
+                (propertize link 'face 'markdown-url-face)))))
    ;; Hidden language name for fenced code blocks
    ((and (markdown-code-block-at-point-p)
          (not (get-text-property (point) 'markdown-pre))
diff --git a/tests/markdown-test.el b/tests/markdown-test.el
index 33310fbd99..b59ddb278c 100644
--- a/tests/markdown-test.el
+++ b/tests/markdown-test.el
@@ -2224,6 +2224,18 @@ See GH-245."
       (should (invisible-p 154))
       (should (invisible-p 156)))))
 
+;;; Markup hiding url tests:
+
+(ert-deftest test-markdown-url-hiding/eldoc ()
+  "Test hiding URL and eldoc.
+Detail: https://github.com/jrblevin/markdown-mode/pull/674";
+  (markdown-test-string "[This is a hidden link](http://hidden.link)"
+    (markdown-toggle-url-hiding +1)
+    (search-forward "(")
+    (markdown-eldoc-function)
+    ;; markdown-eldoc-function doesn't raise an exception
+    (should t)))
+
 ;;; Font lock tests:
 
 (ert-deftest test-markdown-font-lock/italics-1 ()



reply via email to

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