Function: mhtml-ts-mode--js-css-tag-bol

mhtml-ts-mode--js-css-tag-bol is a byte-compiled function defined in mhtml-ts-mode.el.gz.

Signature

(mhtml-ts-mode--js-css-tag-bol NODE PARENT &rest _)

Documentation

Find the first non-space characters of html tags <script> or <style>.

Return line-beginning-position when treesit-node-at is html, or mhtml-ts-mode-tag-relative-indent is equal to ignore. NODE and PARENT are ignored.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/mhtml-ts-mode.el.gz
;; Embedded languages should be indented according to the language
;; that embeds them.
;; This function signature complies with `treesit-simple-indent-rules'
;; ANCHOR.
(defun mhtml-ts-mode--js-css-tag-bol (_node _parent &rest _)
  "Find the first non-space characters of html tags <script> or <style>.
Return `line-beginning-position' when `treesit-node-at' is html, or
`mhtml-ts-mode-tag-relative-indent' is equal to ignore.
NODE and PARENT are ignored."
  (if (or (eq (treesit-language-at (point)) 'html)
          (eq mhtml-ts-mode-tag-relative-indent 'ignore))
      (line-beginning-position)
    ;; Ok, we are in js or css block.
    (save-excursion
      (re-search-backward "<script.*>\\|<style.*>" nil t))))