Function: markdown-ts--table-node-row

markdown-ts--table-node-row is a byte-compiled function defined in markdown-ts-mode.el.gz.

Signature

(markdown-ts--table-node-row &optional NODE POS)

Documentation

Compute table row from named NODE at POS.

If NODE is nil, use the node at POS. If POS is nil, use point. If NODE is a row type, return it. If NODE is a table cell type, return its row. Otherwise, return nil.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/markdown-ts-mode.el.gz
(defun markdown-ts--table-node-row (&optional node pos)
  "Compute table row from named NODE at POS.
If NODE is nil, use the node at POS.
If POS is nil, use `point'.
If NODE is a row type, return it.
If NODE is a table cell type, return its row.
Otherwise, return nil."
  ;; We could sanity check via `treesit-node-named' and error if not.
  (when-let* ((node (or node
                        (treesit-node-at (or pos (point)) 'markdown 'named)))
              (type (treesit-node-type node)))
    (if (member type markdown-ts--table-row-types)
        node
       (treesit-node-parent (markdown-ts--table-node-cell node)))))