Function: org-odt--standalone-link-p
org-odt--standalone-link-p is a byte-compiled function defined in
ox-odt.el.gz.
Signature
(org-odt--standalone-link-p ELEMENT INFO &optional PARAGRAPH-PREDICATE LINK-PREDICATE)
Documentation
Test if ELEMENT is a standalone link for the purpose ODT export.
INFO is a plist holding contextual information.
Return non-nil, if ELEMENT is of type paragraph satisfying PARAGRAPH-PREDICATE and its sole content, save for whitespaces, is a link that satisfies LINK-PREDICATE.
Return non-nil, if ELEMENT is of type link satisfying LINK-PREDICATE and its containing paragraph satisfies PARAGRAPH-PREDICATE in addition to having no other content save for leading and trailing whitespaces.
Return nil, otherwise.
Source Code
;; Defined in /usr/src/emacs/lisp/org/ox-odt.el.gz
(defun org-odt--standalone-link-p (element _info &optional
paragraph-predicate
link-predicate)
"Test if ELEMENT is a standalone link for the purpose ODT export.
INFO is a plist holding contextual information.
Return non-nil, if ELEMENT is of type paragraph satisfying
PARAGRAPH-PREDICATE and its sole content, save for whitespaces,
is a link that satisfies LINK-PREDICATE.
Return non-nil, if ELEMENT is of type link satisfying
LINK-PREDICATE and its containing paragraph satisfies
PARAGRAPH-PREDICATE in addition to having no other content save for
leading and trailing whitespaces.
Return nil, otherwise."
(let ((p (cl-case (org-element-type element)
(paragraph element)
(link (and (or (not link-predicate)
(funcall link-predicate element))
(org-element-parent element)))
(t nil))))
(when (and p (org-element-type-p p 'paragraph))
(when (or (not paragraph-predicate)
(funcall paragraph-predicate p))
(let ((contents (org-element-contents p)))
(cl-loop for x in contents
with inline-image-count = 0
always (cl-case (org-element-type x)
(plain-text
(not (org-string-nw-p x)))
(link
(and (or (not link-predicate)
(funcall link-predicate x))
(= (cl-incf inline-image-count) 1)))
(t nil))))))))