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

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

[nongnu] elpa/markdown-mode 9bac1caf35 1/2: Fix italic fontification aft


From: ELPA Syncer
Subject: [nongnu] elpa/markdown-mode 9bac1caf35 1/2: Fix italic fontification after bold markups
Date: Sat, 22 Oct 2022 03:58:50 -0400 (EDT)

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

    Fix italic fontification after bold markups
---
 CHANGES.md             |  2 ++
 markdown-mode.el       |  6 ++++--
 tests/markdown-test.el | 12 ++++++++++++
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/CHANGES.md b/CHANGES.md
index c208739c6b..fb5ffb4ef8 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -18,10 +18,12 @@
 
 *   Bug fixes:
     - Don't override table faces by link faces [GH-716][]
+    - Fix invalid italic fontification after bold markups[GH-731][]
 
   [gh-572]: https://github.com/jrblevin/markdown-mode/issues/572
   [gh-705]: https://github.com/jrblevin/markdown-mode/issues/705
   [gh-716]: https://github.com/jrblevin/markdown-mode/issues/716
+  [gh-731]: https://github.com/jrblevin/markdown-mode/issues/731
 
 
 # Markdown Mode 2.5
diff --git a/markdown-mode.el b/markdown-mode.el
index aa27e4eda2..ae6dc47988 100644
--- a/markdown-mode.el
+++ b/markdown-mode.el
@@ -2923,7 +2923,8 @@ When FACELESS is non-nil, do not return matches where 
faces have been applied."
                 (markdown-in-comment-p)
                 (markdown-range-property-any
                  begin begin 'face '(markdown-url-face
-                                     markdown-plain-url-face))
+                                     markdown-plain-url-face
+                                     markdown-markup-face))
                 (markdown-range-property-any
                  begin end 'face '(markdown-bold-face
                                    markdown-list-face
@@ -8156,13 +8157,13 @@ newline after."
   (let* ((modified (buffer-modified-p))
          (buffer-undo-list t)
          (inhibit-read-only t)
-         (inhibit-point-motion-hooks t)
          deactivate-mark
          buffer-file-truename)
     (unwind-protect
         (save-excursion
           (save-match-data
             (save-restriction
+              (cursor-intangible-mode +1) ;; inhibit-point-motion-hooks is 
obsoleted since Emacs 29
               ;; Extend the region to fontify so that it starts
               ;; and ends at safe places.
               (cl-multiple-value-bind (new-from new-to)
@@ -8179,6 +8180,7 @@ newline after."
                   (markdown-unfontify-region-wiki-links new-from new-to)
                   ;; Now do the fontification.
                   (markdown-fontify-region-wiki-links new-from new-to))))))
+      (cursor-intangible-mode -1)
       (and (not modified)
            (buffer-modified-p)
            (set-buffer-modified-p nil)))))
diff --git a/tests/markdown-test.el b/tests/markdown-test.el
index a80476301e..5214098a72 100644
--- a/tests/markdown-test.el
+++ b/tests/markdown-test.el
@@ -2467,6 +2467,18 @@ Detail: 
https://github.com/jrblevin/markdown-mode/issues/548";
     (markdown-test-range-has-face 28 33 'markdown-italic-face)
     (markdown-test-range-has-face 34 34 'markdown-markup-face)))
 
+(ert-deftest test-markdown-font-lock/italic-after-bold ()
+  "Test italic fontification after after.
+Detail: https://github.com/jrblevin/markdown-mode/issues/548";
+  (markdown-test-string "__ONE__ TWO _THREE_"
+    (markdown-test-range-has-face 1 2 'markdown-markup-face)
+    (markdown-test-range-has-face 3 5 'markdown-bold-face)
+    (markdown-test-range-has-face 6 7 'markdown-markup-face)
+    (markdown-test-range-has-face 8 12 nil)
+    (markdown-test-range-has-face 13 13 'markdown-markup-face)
+    (markdown-test-range-has-face 14 18 'markdown-italic-face)
+    (markdown-test-range-has-face 19 19 'markdown-markup-face)))
+
 (ert-deftest test-markdown-font-lock/bold-1 ()
   "A simple bold test."
   (markdown-test-file "inline.text"



reply via email to

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