Function: htmlize-decode-invisibility-spec

htmlize-decode-invisibility-spec is a byte-compiled function defined in htmlize.el.

Signature

(htmlize-decode-invisibility-spec INVISIBLE)

Source Code

;; Defined in ~/.emacs.d/elpa/htmlize-20250724.1703/htmlize.el
(defun htmlize-decode-invisibility-spec (invisible)
  ;; Return t, nil, or `ellipsis', depending on how invisible text should
  ;; be inserted.

  (if (not (listp buffer-invisibility-spec))
      ;; If buffer-invisibility-spec is not a list, then all
      ;; characters with non-nil `invisible' property are visible.
      (not invisible)

    ;; Otherwise, the value of a non-nil `invisible' property can be:
    ;; 1. a symbol -- make the text invisible if it matches
    ;;    buffer-invisibility-spec.
    ;; 2. a list of symbols -- make the text invisible if
    ;;    any symbol in the list matches
    ;;    buffer-invisibility-spec.
    ;; If the match of buffer-invisibility-spec has a non-nil
    ;; CDR, replace the invisible text with an ellipsis.
    (let ((match (if (symbolp invisible)
                     (htmlize-match-inv-spec invisible)
                   (cl-some #'htmlize-match-inv-spec invisible))))
      (cond ((null match) t)
            ((cdr-safe (car match)) 'ellipsis)
            (t nil)))))