Function: markdown-fontify-list-items

markdown-fontify-list-items is a byte-compiled function defined in markdown-mode.el.

Signature

(markdown-fontify-list-items LAST)

Documentation

Apply font-lock properties to list markers from point to LAST.

Source Code

;; Defined in ~/.emacs.d/elpa/markdown-mode-20260321.143/markdown-mode.el
(defun markdown-fontify-list-items (last)
  "Apply font-lock properties to list markers from point to LAST."
  (when (markdown-match-list-items last)
    (when (not (markdown-code-block-at-point-p (match-beginning 2)))
      (let* ((indent (length (match-string-no-properties 1)))
             (level (/ indent markdown-list-indent-width)) ;; level = 0, 1, 2, ...
             (bullet (nth (mod level (length markdown-list-item-bullets))
                          markdown-list-item-bullets)))
        (add-text-properties
         (match-beginning 2) (match-end 2) '(face markdown-list-face))
        (when markdown-hide-markup
          (cond
           ;; Unordered lists
           ((string-match-p "[\\*\\+-]" (match-string 2))
            (add-text-properties
             (match-beginning 2) (match-end 2) `(display ,bullet)))
           ;; Definition lists
           ((string-equal ":" (match-string 2))
            (let ((display-string
                   (char-to-string (markdown--first-displayable
                                    markdown-definition-display-char))))
              (add-text-properties (match-beginning 2) (match-end 2)
                                   `(display ,display-string))))))))
    t))