Function: markdown-insert-reference-link

markdown-insert-reference-link is a byte-compiled function defined in markdown-mode.el.

Signature

(markdown-insert-reference-link TEXT LABEL &optional URL TITLE)

Documentation

Insert a reference link and, optionally, a reference definition.

The link TEXT will be inserted followed by the optional LABEL. If a URL is given, also insert a definition for the reference LABEL according to markdown-reference-location. If a TITLE is given, it will be added to the end of the reference definition and will be used to populate the title attribute when converted to XHTML. If URL is nil, insert only the link portion (for example, when a reference label is already defined).

Source Code

;; Defined in ~/.emacs.d/elpa/markdown-mode-20260321.143/markdown-mode.el
(defun markdown-insert-reference-link (text label &optional url title)
  "Insert a reference link and, optionally, a reference definition.
The link TEXT will be inserted followed by the optional LABEL.
If a URL is given, also insert a definition for the reference
LABEL according to `markdown-reference-location'.  If a TITLE is
given, it will be added to the end of the reference definition
and will be used to populate the title attribute when converted
to XHTML.  If URL is nil, insert only the link portion (for
example, when a reference label is already defined)."
  (insert (concat "[" text "][" label "]"))
  (when url
    (markdown-insert-reference-definition
     (if (string-equal label "") text label)
     url title)))