Function: markdown-forward-paragraph

markdown-forward-paragraph is an interactive and byte-compiled function defined in markdown-mode.el.

Signature

(markdown-forward-paragraph &optional ARG)

Documentation

Move forward to the next end of a paragraph.

With argument ARG, do it ARG times; a negative argument ARG = -N means move backward N blocks.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/markdown-mode-20260321.143/markdown-mode.el
(defun markdown-forward-paragraph (&optional arg)
  "Move forward to the next end of a paragraph.
With argument ARG, do it ARG times; a negative argument ARG = -N
means move backward N blocks."
  (interactive "^p")
  (or arg (setq arg 1))
  (if (< arg 0)
      (markdown-backward-paragraph (- arg))
    (dotimes (_ arg)
      ;; Skip whitespace in between paragraphs.
      (when (markdown-cur-line-blank-p)
        (skip-syntax-forward "-")
        (beginning-of-line))
      ;; Proceed forward based on the type of block.
      (let (bounds skip)
        (cond
         ;; Blockquotes
         ((looking-at markdown-regex-blockquote)
          ;; Skip over blank lines inside blockquotes.
          (while (and (not (eobp))
                      (looking-at markdown-regex-blockquote)
                      (= (length (match-string 3)) 0))
            (forward-line))
          ;; Move to end of quoted text block
          (while (and (not (eobp))
                      (looking-at markdown-regex-blockquote)
                      (> (length (match-string 3)) 0)) ;; not blank
            (forward-line)))
         ;; List items
         ((and (markdown-cur-list-item-bounds)
               (setq bounds (markdown-next-list-item-bounds)))
          (goto-char (nth 0 bounds)))
         ;; Other
         (t
          (forward-line)
          (while (and (not (eobp))
                      (not skip)
                      (not (markdown-cur-line-blank-p))
                      (not (looking-at markdown-regex-blockquote))
                      (not (markdown-range-properties-exist
                            (line-beginning-position) (line-end-position)
                            '(markdown-gfm-block-begin
                              markdown-tilde-fence-begin))))
            (setq skip (markdown-range-properties-exist
                        (line-beginning-position) (line-end-position)
                        '(markdown-gfm-block-end
                          markdown-tilde-fence-end)))
            (forward-line))))))))