Function: markdown-insert-wiki-link
markdown-insert-wiki-link is an interactive and natively compiled
function defined in markdown-mode.el.
Signature
(markdown-insert-wiki-link)
Documentation
Insert a wiki link of the form [[WikiLink]].
If there is an active region, use the region as the link text. If the point is at a word, use the word as the link text. If there is no active region and the point is not at word, simply insert link markup.
Key Bindings
markdown-mode-map C-c C-a w markdown-mode-map C-c C-s w markdown-mode-style-map w
Source Code
;; Defined in /nix/store/p33zgg95aglc47pl6zlgs43vki0snxf8-emacs-packages-deps/share/emacs/site-lisp/elpa/markdown-mode-20260827.909/markdown-mode.el
(defun markdown-insert-wiki-link ()
"Insert a wiki link of the form [[WikiLink]].
If there is an active region, use the region as the link text.
If the point is at a word, use the word as the link text. If
there is no active region and the point is not at word, simply
insert link markup."
(interactive)
(if (use-region-p)
;; Active region
(markdown-wrap-or-insert "[[" "]]" nil (region-beginning) (region-end))
;; Markup removal, wiki link at at point, or empty markup insertion
(if (thing-at-point-looking-at markdown-regex-wiki-link)
(if (or markdown-wiki-link-alias-first
(null (match-string 5)))
(markdown-unwrap-thing-at-point nil 1 3)
(markdown-unwrap-thing-at-point nil 1 5))
(markdown-wrap-or-insert "[[" "]]"))))