emacs-orgmode
[Top][All Lists]
Advanced

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

[PATCH] [O] Single opening star induces bold face if immediately preceed


From: Ihor Radchenko
Subject: [PATCH] [O] Single opening star induces bold face if immediately preceeding inlinetask
Date: Sun, 03 Oct 2021 15:53:14 +0800

Alain.Cochard@unistra.fr writes:

> Hello.
>
> With this org file, the "blah" is in bold face.
>
> * foo
> a *blah
> *************** task
> bar
> *************** END
>
> I would it is a small bug.  NB: If I insert a blank line before the
> task, the face goes back to normal.

Thanks for your report. It took a while to process, but here is the fix.

Best,
Ihor

>From ae325834b75944d81ad57087336ca6efa6e57480 Mon Sep 17 00:00:00 2001
Message-Id: 
<ae325834b75944d81ad57087336ca6efa6e57480.1633247511.git.yantar92@gmail.com>
From: Ihor Radchenko <yantar92@gmail.com>
Date: Sun, 3 Oct 2021 15:48:23 +0800
Subject: [PATCH] org.el: Do not span emphasis over inlinetask boundaries

* lisp/org.el (org-do-emphasis-faces): Check paragraph boundaries
within emphasis even when the boundary is not starting right at the
beginning of the emphasis.

Fixes https://orgmode.org/list/23707.20428.546749.44853@frac.u-strasbg.fr
---
 lisp/org.el | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 3546e7edd..1551986f6 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5096,8 +5096,14 @@ (defun org-do-emphasis-faces (limit)
                   ;; Match full emphasis markup regexp.
                   (looking-at (if verbatim? org-verbatim-re org-emph-re))
                   ;; Do not span over paragraph boundaries.
-                  (not (string-match-p org-element-paragraph-separate
-                                       (match-string 2)))
+                  (not (save-match-data
+                        (save-excursion
+                          (goto-char (match-beginning 2))
+                          (re-search-forward org-element-paragraph-separate
+                                             (save-excursion
+                                               (goto-char (match-end 2))
+                                               (line-end-position))
+                                             'noerror))))
                   ;; Do not span over cells in table rows.
                   (not (and (save-match-data (org-match-line "[ \t]*|"))
                             (string-match-p "|" (match-string 4))))))
-- 
2.32.0


reply via email to

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