org-lint: Do not warn about trailing *** lines inside blocks

* lisp/org-lint.el (org-lint-misplaced-heading): The chances that
there is a heading between #+begin... #+end lines is generally low.
So *** text instances are likely intended.

Reported-by: Suhail Singh <suhailsingh247@gmail.com>
Link: https://orgmode.org/list/87r0dc35ya.fsf@gmail.com
This commit is contained in:
Ihor Radchenko 2024-06-05 15:12:30 +02:00
parent ac1d58477a
commit b8497aa7fe
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 2 additions and 1 deletions

View File

@ -395,7 +395,8 @@ called with one argument, the key used for comparison."
;; Heuristics for 2+ level heading not at bol. ;; Heuristics for 2+ level heading not at bol.
(while (re-search-forward (rx (not (any "*\n\r ,")) ;; Not a bol; not escaped ,** heading; not " *** words" (while (re-search-forward (rx (not (any "*\n\r ,")) ;; Not a bol; not escaped ,** heading; not " *** words"
"*" (1+ "*") " ") nil t) "*" (1+ "*") " ") nil t)
(push (list (match-beginning 0) "Possibly misplaced heading line") result)) (unless (org-at-block-p) ; Inside a block, where the chances to have heading a slim.
(push (list (match-beginning 0) "Possibly misplaced heading line") result)))
result))) result)))
(defun org-lint-duplicate-custom-id (ast) (defun org-lint-duplicate-custom-id (ast)