forked from mirrors/org-mode
Merge branch 'maint'
This commit is contained in:
commit
872666f738
|
@ -765,7 +765,7 @@ white spaces. Match group 2 contains the same string without any
|
||||||
surrounding space. Match group 3 contains the label.
|
surrounding space. Match group 3 contains the label.
|
||||||
|
|
||||||
A coderef format regexp can only match at the end of a line."
|
A coderef format regexp can only match at the end of a line."
|
||||||
(format "\\S-\\([ \t]*\\(%s\\)[ \t]*\\)$"
|
(format "\\([ \t]*\\(%s\\)[ \t]*\\)$"
|
||||||
(replace-regexp-in-string
|
(replace-regexp-in-string
|
||||||
"%s"
|
"%s"
|
||||||
(if label (regexp-quote label) "\\([-a-zA-Z0-9_][-a-zA-Z0-9_ ]*\\)")
|
(if label (regexp-quote label) "\\([-a-zA-Z0-9_][-a-zA-Z0-9_ ]*\\)")
|
||||||
|
|
15
lisp/ox.el
15
lisp/ox.el
|
@ -4171,18 +4171,15 @@ error if no block contains REF."
|
||||||
(lambda (el)
|
(lambda (el)
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(insert (org-trim (org-element-property :value el)))
|
(insert (org-trim (org-element-property :value el)))
|
||||||
(let* ((label-fmt (regexp-quote
|
(let* ((label-fmt (or (org-element-property :label-fmt el)
|
||||||
(or (org-element-property :label-fmt el)
|
org-coderef-label-format))
|
||||||
org-coderef-label-format)))
|
(ref-re (org-src-coderef-regexp label-fmt ref)))
|
||||||
(ref-re
|
|
||||||
(format "^.*?\\S-.*?\\([ \t]*\\(%s\\)\\)[ \t]*$"
|
|
||||||
(format label-fmt ref))))
|
|
||||||
;; Element containing REF is found. Resolve it to
|
;; Element containing REF is found. Resolve it to
|
||||||
;; either a label or a line number, as needed.
|
;; either a label or a line number, as needed.
|
||||||
(when (re-search-backward ref-re nil t)
|
(when (re-search-backward ref-re nil t)
|
||||||
(cond
|
(if (org-element-property :use-labels el) ref
|
||||||
((org-element-property :use-labels el) ref)
|
(+ (or (org-export-get-loc el info) 0)
|
||||||
(t (+ (or (org-export-get-loc el info) 0) (line-number-at-pos))))))))
|
(line-number-at-pos)))))))
|
||||||
info 'first-match)
|
info 'first-match)
|
||||||
(signal 'org-link-broken (list ref))))
|
(signal 'org-link-broken (list ref))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue