Function: markdown-ts--tocs-sanity-check

markdown-ts--tocs-sanity-check is a byte-compiled function defined in markdown-ts-mode-x.el.gz.

Signature

(markdown-ts--tocs-sanity-check TOCS)

Documentation

Sanity check TOCS for paired markdown-ts-toc: markdown-ts-toc-end: nodes.

Signal an error if TOCS are insane. See markdown-ts--tocs.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/markdown-ts-mode-x.el.gz
(defun markdown-ts--tocs-sanity-check (tocs)
  "Sanity check TOCS for paired markdown-ts-toc: markdown-ts-toc-end: nodes.
Signal an error if TOCS are insane.
See `markdown-ts--tocs'."
  (seq-map-indexed
   (lambda (elt idx)
     (when (equal "markdown-ts-toc" (car elt))
       (unless (equal "markdown-ts-toc-end" (car (nth (1+ idx) tocs)))
         (user-error
          "\"markdown-ts-toc\" at position %d must be followed by a matching \"markdown-ts-toc-end\""
          (alist-get 'beg elt)))))
   tocs))