org-lint: Fix heuristics introduced in 51aea4946
* lisp/org-lint.el (org-lint-misplaced-heading): Use parser to query whether we are inside a verbatim block. `org-at-block-p' only triggers on the begin line of blocks.
This commit is contained in:
parent
2f184485bf
commit
6c862699a6
|
@ -395,7 +395,10 @@ 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)
|
||||||
(unless (org-at-block-p) ; Inside a block, where the chances to have heading a slim.
|
(unless (org-element-type-p
|
||||||
|
(org-element-at-point)
|
||||||
|
'(comment-block example-block export-block src-block)
|
||||||
|
) ; Inside a block, where the chances to have heading a slim.
|
||||||
(push (list (match-beginning 0) "Possibly misplaced heading line") result)))
|
(push (list (match-beginning 0) "Possibly misplaced heading line") result)))
|
||||||
result)))
|
result)))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue