Function: markdown-code-block-at-pos

markdown-code-block-at-pos is a byte-compiled function defined in markdown-mode.el.

Signature

(markdown-code-block-at-pos POS)

Documentation

Return match data list if there is a code block at POS.

Uses text properties at the beginning of the line position. This includes pre blocks, tilde-fenced code blocks, and GFM quoted code blocks. Return nil otherwise.

Source Code

;; Defined in ~/.emacs.d/elpa/markdown-mode-20260321.143/markdown-mode.el
(defun markdown-code-block-at-pos (pos)
  "Return match data list if there is a code block at POS.
Uses text properties at the beginning of the line position.
This includes pre blocks, tilde-fenced code blocks, and GFM
quoted code blocks.  Return nil otherwise."
  (let ((bol (save-excursion (goto-char pos) (line-beginning-position))))
    (or (get-text-property bol 'markdown-pre)
        (let* ((bounds (markdown-get-enclosing-fenced-block-construct pos))
               (second (cl-second bounds)))
          (if second
              ;; chunks are right open
              (when (< pos second)
                bounds)
            bounds)))))