Function: markdown-ts--toc-list-item-depth

markdown-ts--toc-list-item-depth is a byte-compiled function defined in markdown-ts-mode-x.el.gz.

Signature

(markdown-ts--toc-list-item-depth NODE)

Documentation

Return NODE's item depth relative to its predecessors.

If NODE is not part of a list, return nil.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/markdown-ts-mode-x.el.gz
(defun markdown-ts--toc-list-item-depth (node)
  "Return NODE's item depth relative to its predecessors.
If NODE is not part of a list, return nil."
    (let ((depth nil) (n (treesit-node-parent node)))
      (while n
        (when (equal (treesit-node-type n) "list")
          (setq depth (1+ (or depth 0))))
        (setq n (treesit-node-parent n)))
      depth))