Browse Source

org.el (org-do-emphasis-faces): Fix false positives handling

* org.el (org-do-emphasis-faces): Handle false positives by
restarting the re-search one char after the beginning of the
match, not one char before its ending.

Before this fix, consider this buffer

** Headline
  - *Bold* non-bold
  - *Bold* non-bold

The first false positive is "** Headline\n  - *Bold*"

Starting the search again from the last "*" will skip
the "*Bold*" string.  Starting again at "* Headline" will
find it.
Bastien Guerry 11 years ago
parent
commit
f21150f185
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lisp/org.el

+ 1 - 1
lisp/org.el

@@ -5693,7 +5693,7 @@ The time stamps may be either active or inactive.")
 				   '(invisible org-link))
 	      (add-text-properties (match-beginning 3) (match-end 3)
 				   '(invisible org-link)))))
-      (backward-char 1))
+      (goto-char (1+ (match-beginning 0))))
     rtn))
 
 (defun org-emphasize (&optional char)