forked from mirrors/org-mode
org-latex-preview: Get face from char before latex
* lisp/org-latex-preview.el (org-create-latex-preview): Instead of getting the face using `face-at-point' use `get-text-property' on the position one before the start of the LaTeX fragment. This ensures that the face is that of the parent element rather than the LaTeX fragment.
This commit is contained in:
parent
0a9236e251
commit
333f19c6f8
|
@ -516,9 +516,9 @@ Some of the options can be changed using the variable
|
|||
(skip-chars-backward " \r\t\n")
|
||||
(point)))
|
||||
(value (org-element-property :value element))
|
||||
(face (save-excursion
|
||||
(goto-char beg)
|
||||
(face-at-point)))
|
||||
(face (or (and (> beg 1)
|
||||
(get-text-property (1- beg) 'face))
|
||||
'default))
|
||||
(fg (pcase (plist-get org-format-latex-options :foreground)
|
||||
('auto (face-attribute face :foreground nil 'default))
|
||||
('default (face-attribute 'default :foreground nil))
|
||||
|
|
Loading…
Reference in New Issue