You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14358 lines
518 KiB

;;; web-mode.el --- major mode for editing web templates
;;; -*- coding: utf-8; lexical-binding: t; -*-
;; Copyright 2011-2020 François-Xavier Bois
;; Version: 17.0.2
;; Package-Version: 20200826.1954
;; Package-Commit: da53553fd4e876ac121994cc48e54ab54fa3ace7
;; Author: François-Xavier Bois <fxbois AT Google Mail Service>
;; Maintainer: François-Xavier Bois
;; Package-Requires: ((emacs "23.1"))
;; URL: http://web-mode.org
;; Repository: http://github.com/fxbois/web-mode
;; Created: July 2011
;; Keywords: languages
;; License: GNU General Public License >= 2
;; Distribution: This file is not part of Emacs
;;; Commentary:
;;==============================================================================
;; WEB-MODE is sponsored by ** Kernix ** Best Digital Factory & Data Lab (Paris)
;;==============================================================================
;;; Code:
;;---- CONSTS ------------------------------------------------------------------
(defconst web-mode-version "17.0.1"
"Web Mode version.")
;;---- GROUPS ------------------------------------------------------------------
(defgroup web-mode nil
"Major mode for editing web templates"
:group 'languages
:prefix "web-"
:link '(url-link :tag "Site" "http://web-mode.org")
:link '(url-link :tag "Repository" "https://github.com/fxbois/web-mode"))
(defgroup web-mode-faces nil
"Faces for syntax highlighting."
:group 'web-mode
:group 'faces)
;;---- CUSTOMS -----------------------------------------------------------------
(defcustom web-mode-block-padding 0
"Multi-line block (php, ruby, java, python, asp, etc.) left padding.
-1 to have to code aligned on the column 0."
:type '(choice (integer :tags "Number of spaces")
(const :tags "No indent" nil))
:group 'web-mode)
(defcustom web-mode-part-padding 1
"Part elements (script, style) left padding."
:type '(choice (integer :tags "Number of spaces")
(const :tags "No indent" nil))
:group 'web-mode)
(defcustom web-mode-script-padding web-mode-part-padding
"Script element left padding."
:type '(choice (integer :tags "Number of spaces")
(const :tags "No indent" nil))
:group 'web-mode)
(defcustom web-mode-style-padding web-mode-part-padding
"Style element left padding."
:type '(choice (integer :tags "Number of spaces")
(const :tags "No indent" nil))
:group 'web-mode)
(defcustom web-mode-attr-indent-offset nil
"Html attribute indentation level."
:type '(choice (integer :tags "Number of spaces")
(const :tags "Default" nil))
:safe #'(lambda (v) (or (integerp v) (booleanp v)))
:group 'web-mode)
(defcustom web-mode-attr-value-indent-offset nil
"Html attribute value indentation level."
:type '(choice (integer :tags "Number of spaces")
(const :tags "Default" nil))
:safe #'(lambda (v) (or (integerp v) (booleanp v)))
:group 'web-mode)
(defcustom web-mode-markup-indent-offset
(if (and (boundp 'standard-indent) standard-indent) standard-indent 2)
"Html indentation level."
:type 'integer
:safe #'integerp
:group 'web-mode)
(defcustom web-mode-css-indent-offset
(if (and (boundp 'standard-indent) standard-indent) standard-indent 2)
"CSS indentation level."
:type 'integer
:safe #'integerp
:group 'web-mode)
(defcustom web-mode-code-indent-offset
(if (and (boundp 'standard-indent) standard-indent) standard-indent 2)
"Code (javascript, php, etc.) indentation level."
:type 'integer
:safe #'integerp
:group 'web-mode)
(defcustom web-mode-sql-indent-offset 4
"Sql (inside strings) indentation level."
:type 'integer
:safe #'integerp
:group 'web-mode)
(defcustom web-mode-enable-css-colorization (display-graphic-p)
"In a CSS part, set background according to the color: #xxx, rgb(x,x,x)."
:type 'boolean
:group 'web-mode)
(defcustom web-mode-enable-comment-interpolation nil
"Enable highlight of keywords like FIXME, TODO, etc. in comments."
:type 'boolean
:group 'web-mode)
(defcustom web-mode-enable-comment-annotation nil
"Enable annotation in comments (jsdoc, phpdoc, etc.)."
:type 'boolean
:group 'web-mode)
(defcustom web-mode-enable-auto-indentation (display-graphic-p)
"Auto-indentation."
:type 'boolean
:group 'web-mode)
(defcustom web-mode-enable-auto-closing (display-graphic-p)
"Auto-closing."
:type 'boolean
:group 'web-mode)
(defcustom web-mode-enable-auto-pairing (display-graphic-p)
"Auto-pairing."
:type 'boolean
:group 'web-mode)
(defcustom web-mode-enable-auto-opening (display-graphic-p)
"Html element auto-opening."
:type 'boolean
:group 'web-mode)
(defcustom web-mode-enable-auto-quoting (display-graphic-p)
"Add double quotes after the character = in a tag."
:type 'boolean
:group 'web-mode)
(defcustom web-mode-enable-auto-expanding nil
"e.g. s/ expands to <span>|</span>."
:type 'boolean
:group 'web-mode)
(defcustom web-mode-enable-control-block-indentation t
"Control blocks increase indentation."
:type 'boolean
:group 'web-mode)
(defcustom web-mode-enable-current-element-highlight nil
"Enable current element highlight."
:type 'boolean
:group 'web-mode)
(defcustom web-mode-enable-current-column-highlight nil
"Show column for current element."
:type 'boolean
:group 'web-mode)
(defcustom web-mode-enable-whitespace-fontification nil
"Enable whitespaces."
:type 'boolean
:group 'web-mode)
(defcustom web-mode-enable-html-entities-fontification nil
"Enable html entities fontification."
:type 'boolean
:group 'web-mode)
(defcustom web-mode-enable-block-face nil
"Enable block face (useful for setting a background for example).
See web-mode-block-face."
:type 'boolean
:group 'web-mode)
(defcustom web-mode-enable-part-face nil
"Enable part face (useful for setting background of <style> or <script>
elements for example). See web-mode-part-face."
:type 'boolean
:group 'web-mode)
(defcustom web-mode-enable-inlays nil
"Enable inlays (e.g. LaTeX) highlighting."
:type 'boolean
:group 'web-mode)
(defcustom web-mode-enable-sexp-functions t
"Enable specific sexp functions."
:type 'boolean
:group 'web-mode)
(defcustom web-mode-enable-string-interpolation t
"Enable string interpolation fontification (php and erb)."
:type 'boolean
:group 'web-mode)
(defcustom web-mode-enable-literal-interpolation t
"Enable template literal fontification. e.g. css` `."
:type 'boolean
:group 'web-mode)
(defcustom web-mode-enable-sql-detection nil
"Enable fontification and indentation of sql queries in strings."
:type 'boolean
:group 'web-mode)
(defcustom web-mode-enable-heredoc-fontification t
"Enable heredoc fontification. The identifier should contain JS, JAVASCRIPT, CSS or HTML."
:type 'boolean
:group 'web-mode)
(defcustom web-mode-enable-element-content-fontification nil
"Enable element content fontification. The content of an element can have a face associated."
:type 'boolean
:group 'web-mode)
(defcustom web-mode-enable-element-tag-fontification nil
"Enable tag name fontification."
:type 'boolean
:group 'web-mode)
(defcustom web-mode-enable-front-matter-block nil
"Enable front matter block (data at the beginning the template between --- and ---)."
:type 'boolean
:group 'web-mode)
(defcustom web-mode-enable-engine-detection nil
"Detect such directive -*- engine: ENGINE -*- at the top of the file."
:type 'boolean
:group 'web-mode)
(defcustom web-mode-enable-optional-tags nil
"Enable omission of certain closing tags (e.g. a li open tag followed by a li open tag is valid)."
:type 'boolean
:group 'web-mode)
(defcustom web-mode-comment-style 1
"Comment style : 1 = default, 2 = force server comments outside a block."
:group 'web-mode
:type '(choice (const :tag "Default" 1)
(const :tag "Force engine comments" 2)))
(defcustom web-mode-indent-style 2
"Indentation style."
:group 'web-mode
:type '(choice (const :tag "Default (all lines are indented)" 2)
(const :tag "Text at the beginning of line is not indented" 1)))
(defcustom web-mode-auto-close-style 1
"Auto-close style."
:group 'web-mode
:type '(choice (const :tag "Auto-close on </" 1)
(const :tag "Auto-close on > and </" 2)
(const :tag "Auto-close on < and >/>" 3)))
(defcustom web-mode-auto-quote-style 1
"Auto-quoting style."
:group 'web-mode
:type '(choice (const :tag "Auto-quotes with double quote" 1)
(const :tag "Auto-quotes with single quote" 2)
(const :tag "Auto-quotes with paren (for jsx)" 3)))
(defcustom web-mode-extra-expanders '()
"A list of additional expanders."
:type '(alist :key-type string :value-type string)
:group 'web-mode)
(defcustom web-mode-extra-auto-pairs '()
"A list of additional auto-pairs."
:type '(alist :key-type string :value-type string)
:group 'web-mode)
(defcustom web-mode-extra-snippets '()
"A list of additional snippets."
:type '(alist :key-type string :value-type string)
:group 'web-mode)
(defcustom web-mode-extra-builtins '()
"A list of additional builtins."
:type '(alist :key-type string :value-type string)
:group 'web-mode)
(defcustom web-mode-extra-constants '()
"A list of additional constants."
:type '(alist :key-type string :value-type string)
:group 'web-mode)
(defcustom web-mode-extra-keywords '()
"A list of additional keywords."
:type '(alist :key-type string :value-type string)
:group 'web-mode)
(defcustom web-mode-extra-types '()
"A list of additional types."
:type '(alist :key-type string :value-type string)
:group 'web-mode)
(defcustom web-mode-extra-control-blocks '()
"A list of additional control blocks."
:type '(alist :key-type string :value-type string)
:group 'web-mode)
(defcustom web-mode-tests-directory (concat default-directory "tests/")
"Directory containing all the unit tests."
:type 'directory
:group 'web-mode)
(defcustom web-mode-jsx-depth-faces
nil
;;'(web-mode-jsx-depth-1-face web-mode-jsx-depth-2-face web-mode-jsx-depth-3-face web-mode-jsx-depth-4-face web-mode-jsx-depth-5-face)
"Each jsx depth has is own face."
:type '(repeat face)
:group 'web-mode)
(defcustom web-mode-commands-like-expand-region
'(web-mode-mark-and-expand er/expand-region mc/mark-next-like-this)
"Add it to here if you have some wrapper function for er/expand-region"
:type '(repeat function)
:group 'web-mode)
(defcustom web-mode-comment-formats
'(("java" . "/*")
("javascript" . "/*")
("typescript" . "//")
("php" . "/*")
("css" . "/*"))
"Default comment format for a language"
:type '(alist :key-type string :value-type string)
:group 'web-mode)
(defcustom web-mode-script-template-types
'("text/x-handlebars"
"text/x-jquery-tmpl"
"text/x-jsrender"
"text/html"
"text/ng-template"
"text/x-template"
"text/mustache"
"text/x-dust-template")
"<script> block types that are interpreted as HTML."
:type '(repeat string)
:group 'web-mode)
;;---- FACES -------------------------------------------------------------------
(defface web-mode-error-face
'((t :background "red"))
"Face for warning."
:group 'web-mode-faces)
(defface web-mode-warning-face
'((t :inherit font-lock-warning-face))
"Face for warning."
:group 'web-mode-faces)
(defface web-mode-preprocessor-face
'((t :inherit font-lock-preprocessor-face))
"Face for preprocessor commands."
:group 'web-mode-faces)
(defface web-mode-preprocessor-face
'((t :inherit font-lock-preprocessor-face))
"Face for preprocessor."
:group 'web-mode-faces)
(defface web-mode-block-delimiter-face
'((t :inherit font-lock-preprocessor-face))
"Face for block delimiters."
:group 'web-mode-faces)
(defface web-mode-block-control-face
'((t :inherit font-lock-preprocessor-face))
"Face for preprocessor."
:group 'web-mode-faces)
(defface web-mode-builtin-face
'((t :inherit font-lock-builtin-face))
"Face for builtins."
:group 'web-mode-faces)
(defface web-mode-symbol-face
'((t :foreground "goldenrod2"))
"Face for symbols."
:group 'web-mode-faces)
(defface web-mode-doctype-face
'((t :foreground "Grey"))
"Face for html doctype."
:group 'web-mode-faces)
(defface web-mode-html-tag-face
'((((class color) (min-colors 88) (background dark)) :foreground "Snow4")
(((class color) (min-colors 88) (background light)) :foreground "Snow4")
(((class color) (min-colors 16) (background dark)) :foreground "Snow4")
(((class color) (min-colors 16) (background light)) :foreground "Grey15")
(((class color) (min-colors 8)) :foreground "Snow4")
(((type tty) (class mono)) :inverse-video t)
(t :foreground "Snow4"))
"Face for html tags."
:group 'web-mode-faces)
(defface web-mode-html-tag-custom-face
'((t :inherit web-mode-html-tag-face))
"Face for html custom tags (e.g. <polymer-element>)."
:group 'web-mode-faces)
(defface web-mode-html-tag-unclosed-face
'((t :inherit web-mode-html-tag-face :underline t))
"Face for unclosed tags."
:group 'web-mode-faces)
(defface web-mode-html-tag-namespaced-face
'((t :inherit web-mode-block-control-face))
"Face for html namespaced tags (e.g. <c:forEach>)."
:group 'web-mode-faces)
(defface web-mode-html-tag-bracket-face
'((((class color) (min-colors 88) (background dark)) :foreground "Snow3")
(((class color) (min-colors 88) (background light)) :foreground "Grey14")
(((class color) (min-colors 16) (background dark)) :foreground "Snow3")
(((class color) (min-colors 16) (background light)) :foreground "Grey14")
(((class color) (min-colors 8)) :foreground "Snow3")
(((type tty) (class mono)) :inverse-video t)
(t :foreground "Snow3"))
"Face for html tags angle brackets (<, > and />)."
:group 'web-mode-faces)
(defface web-mode-html-attr-name-face
'((((class color) (min-colors 88) (background dark)) :foreground "Snow3")
(((class color) (min-colors 88) (background light)) :foreground "Snow4")
(((class color) (min-colors 16) (background dark)) :foreground "Snow3")
(((class color) (min-colors 16) (background light)) :foreground "Grey13")
(((class color) (min-colors 8)) :foreground "Snow3")
(((type tty) (class mono)) :inverse-video t)
(t :foreground "Snow4"))
"Face for html attribute names."
:group 'web-mode-faces)
(defface web-mode-html-attr-custom-face
'((t :inherit web-mode-html-attr-name-face))
"Face for custom attribute names (e.g. data-*)."
:group 'web-mode-faces)
(defface web-mode-html-attr-engine-face
'((t :inherit web-mode-block-delimiter-face))
"Face for custom engine attribute names (e.g. ng-*)."
:group 'web-mode-faces)
(defface web-mode-html-attr-equal-face
'((t :inherit web-mode-html-attr-name-face))
"Face for the = character between name and value."
:group 'web-mode-faces)
(defface web-mode-html-attr-value-face
'((t :inherit font-lock-string-face))
"Face for html attribute values."
:group 'web-mode-faces)
(defface web-mode-block-attr-name-face
'((t :foreground "#8fbc8f"))
"Face for block attribute names."
:group 'web-mode-faces)
(defface web-mode-block-attr-value-face
'((t :foreground "#5f9ea0"))
"Face for block attribute values."
:group 'web-mode-faces)
(defface web-mode-variable-name-face
'((t :inherit font-lock-variable-name-face))
"Face for variable names."
:group 'web-mode-faces)
(defface web-mode-css-selector-face
'((t :inherit font-lock-keyword-face))
"Face for CSS rules."
:group 'web-mode-faces)
(defface web-mode-css-pseudo-class-face
'((t :inherit font-lock-builtin-face))
"Face for CSS pseudo-classes."
:group 'web-mode-faces)
(defface web-mode-css-at-rule-face
'((t :inherit font-lock-constant-face))
"Face for CSS at-rules."
:group 'web-mode-faces)
(defface web-mode-css-property-name-face
'((t :inherit font-lock-variable-name-face))
"Face for CSS props."
:group 'web-mode-faces)
(defface web-mode-css-color-face
'((t :inherit font-lock-builtin-face))
"Face for CSS colors (#xxx)."
:group 'web-mode-faces)
(defface web-mode-css-priority-face
'((t :inherit font-lock-builtin-face))
"Face for CSS priority (!important)."
:group 'web-mode-faces)
(defface web-mode-css-function-face
'((t :inherit font-lock-builtin-face))
"Face for CSS functions."
:group 'web-mode-faces)
(defface web-mode-css-variable-face
'((t :inherit web-mode-variable-name-face :slant italic))
"Face for CSS vars."
:group 'web-mode-faces)
(defface web-mode-function-name-face
'((t :inherit font-lock-function-name-face))
"Face for function names."
:group 'web-mode-faces)
(defface web-mode-filter-face
'((t :inherit font-lock-function-name-face))
"Face for function names."
:group 'web-mode-faces)
(defface web-mode-function-call-face
'((t :inherit font-lock-function-name-face))
"Face for function calls."
:group 'web-mode-faces)
(defface web-mode-string-face
'((t :inherit font-lock-string-face))
"Face for strings."
:group 'web-mode-faces)
(defface web-mode-block-string-face
'((t :inherit web-mode-string-face))
"Face for block strings."
:group 'web-mode-faces)
(defface web-mode-part-string-face
'((t :inherit web-mode-string-face))
"Face for part strings."
:group 'web-mode-faces)
(defface web-mode-javascript-string-face
'((t :inherit web-mode-string-face))
"Face for javascript strings."
:group 'web-mode-faces)
(defface web-mode-interpolate-color1-face
'((t :inherit web-mode-string-face))
"Face for element interpolation strings."
:group 'web-mode-faces)
(defface web-mode-interpolate-color2-face
'((t :inherit web-mode-string-face))
"Face for element interpolation strings."
:group 'web-mode-faces)
(defface web-mode-interpolate-color3-face
'((t :inherit web-mode-string-face))
"Face for element interpolation strings."
:group 'web-mode-faces)
(defface web-mode-css-string-face
'((t :inherit web-mode-string-face))
"Face for css strings."
:group 'web-mode-faces)
(defface web-mode-json-key-face
'((t :foreground "plum"))
"Face for json key strings."
:group 'web-mode-faces)
(defface web-mode-json-context-face
'((t :foreground "orchid3"))
"Face for json context strings."
:group 'web-mode-faces)
(defface web-mode-json-string-face
'((t :inherit web-mode-string-face))
"Face for json strings."
:group 'web-mode-faces)
(defface web-mode-comment-face
'((t :inherit font-lock-comment-face))
"Face for comments."
:group 'web-mode-faces)
(defface web-mode-block-comment-face
'((t :inherit web-mode-comment-face))
"Face for server comments."
:group 'web-mode-faces)
(defface web-mode-part-comment-face
'((t :inherit web-mode-comment-face))
"Face for part comments."
:group 'web-mode-faces)
(defface web-mode-json-comment-face
'((t :inherit web-mode-comment-face))
"Face for json comments."
:group 'web-mode-faces)
(defface web-mode-javascript-comment-face
'((t :inherit web-mode-comment-face))
"Face for javascript comments."
:group 'web-mode-faces)
(defface web-mode-css-comment-face
'((t :inherit web-mode-comment-face))
"Face for css comments."
:group 'web-mode-faces)
(defface web-mode-annotation-face
'((t :inherit web-mode-comment-face))
"Face for code annotations."
:group 'web-mode-faces)
(defface web-mode-annotation-tag-face
'((t :inherit web-mode-annotation-face :underline t))
"Face for @tags in code annotations."
:group 'web-mode-faces)
(defface web-mode-annotation-type-face
'((t :inherit web-mode-annotation-face :weight bold))
"Face for types in code annotations."
:group 'web-mode-faces)
(defface web-mode-annotation-value-face
'((t :inherit web-mode-annotation-face :slant italic))
"Face for values in code annotations."
:group 'web-mode-faces)
(defface web-mode-annotation-html-face
'((t :inherit web-mode-annotation-face :slant italic))
"Face for HTML tags in code annotations."
:group 'web-mode-faces)
(defface web-mode-constant-face
'((t :inherit font-lock-constant-face))
"Face for language constants."
:group 'web-mode-faces)
(defface web-mode-type-face
'((t :inherit font-lock-type-face))
"Face for language types."
:group 'web-mode-faces)
(defface web-mode-keyword-face
'((t :inherit font-lock-keyword-face))
"Face for language keywords."
:group 'web-mode-faces)
(defface web-mode-param-name-face
'((t :foreground "Snow3"))
"Face for server attribute names."
:group 'web-mode-faces)
(defface web-mode-whitespace-face
'((t :background "DarkOrchid4"))
"Face for whitespaces."
:group 'web-mode-faces)
(defface web-mode-inlay-face
'((((class color) (min-colors 88) (background dark)) :background "Black")
(((class color) (min-colors 88) (background light)) :background "LightYellow1")
(((class color) (min-colors 16) (background dark)) :background "Brey18")
(((class color) (min-colors 16) (background light)) :background "LightYellow1")
(((class color) (min-colors 8)) :background "Black")
(((type tty) (class mono)) :inverse-video t)
(t :background "Grey"))
"Face for inlays. Must be used in conjunction with web-mode-enable-inlays."
:group 'web-mode-faces)
(defface web-mode-block-face
'((((class color) (min-colors 88) (background dark)) :background "Black")
(((class color) (min-colors 88) (background light)) :background "LightYellow1")
(((class color) (min-colors 16) (background dark)) :background "Grey18")
(((class color) (min-colors 16) (background light)) :background "LightYellow1")
(((class color) (min-colors 8)) :background "Black")
(((type tty) (class mono)) :inverse-video t)
(t :background "Grey"))
"Face for blocks (useful for setting a background for example).
Must be used in conjunction with web-mode-enable-block-face."
:group 'web-mode-faces)
(defface web-mode-part-face
'((t :inherit web-mode-block-face))
"Face for parts."
:group 'web-mode-faces)
(defface web-mode-script-face
'((t :inherit web-mode-part-face))
"Face for javascript inside a script element."
:group 'web-mode-faces)
(defface web-mode-style-face
'((t :inherit web-mode-part-face))
"Face for css inside a style element."
:group 'web-mode-faces)
(defface web-mode-folded-face
'((t :underline t))
"Overlay face for folded."
:group 'web-mode-faces)
(defface web-mode-bold-face
'((t :weight bold))
"bold face."
:group 'web-mode-faces)
(defface web-mode-italic-face
'((t :slant italic))
"bold face."
:group 'web-mode-faces)
(defface web-mode-underline-face
'((t :underline t))
"bold face."
:group 'web-mode-faces)
(defface web-mode-current-element-highlight-face
'((t :background "#000000" :foreground "#ffffff"))
"Overlay face for element highlight."
:group 'web-mode-faces)
(defface web-mode-current-column-highlight-face
'((t :background "#3e3c36"))
"Overlay face for current column."
:group 'web-mode-faces)
(defface web-mode-comment-keyword-face
'((t :weight bold :box t))
"Comment keywords."
:group 'web-mode-faces)
(defface web-mode-sql-keyword-face
'((t :weight bold :slant italic))
"Sql keywords."
:group 'web-mode-faces)
(defface web-mode-html-entity-face
'((t :slant italic))
"Face html entities (e.g. &#8211;, &eacute;)."
:group 'web-mode-faces)
;; https://material.io/tools/color/#!/?view.left=0&view.right=0
(defface web-mode-jsx-depth-1-face
'((t :background "#000053"))
"jsx depth 1"
:group 'web-mode-faces)
(defface web-mode-jsx-depth-2-face
'((t :background "#001970"))
"jsx"
:group 'web-mode-faces)
(defface web-mode-jsx-depth-3-face
'((t :background "#002984"))
"jsx"
:group 'web-mode-faces)
(defface web-mode-jsx-depth-4-face
'((t :background "#49599a"))
"jsx"
:group 'web-mode-faces)
(defface web-mode-jsx-depth-5-face
'((t :background "#9499b7"))
"jsx"
:group 'web-mode-faces)
;;---- VARS --------------------------------------------------------------------
(defvar font-lock-beg)
(defvar font-lock-end)
(defvar web-mode-auto-pairs nil)
(defvar web-mode-block-regexp nil)
(defvar web-mode-change-beg nil)
(defvar web-mode-change-end nil)
(defvar web-mode-chunk-length 64)
(defvar web-mode-column-overlays nil)
(defvar web-mode-comments-invisible nil)
(defvar web-mode-content-type "")
(defvar web-mode-engine nil)
;;(defvar web-mode-engine-attr-regexp nil)
(defvar web-mode-engine-font-lock-keywords nil)
(defvar web-mode-engine-token-regexp nil)
(defvar web-mode-expand-initial-pos nil)
(defvar web-mode-expand-initial-scroll nil)
(defvar web-mode-expand-previous-state "")
;;(defvar web-mode-font-lock-keywords '(web-mode-font-lock-highlight))
(defvar web-mode-skip-fontification nil)
(defvar web-mode-inlay-regexp nil)
(defvar web-mode-is-scratch nil)
(defvar web-mode-jshint-errors 0)
(defvar web-mode-minor-engine nil)
(defvar web-mode-obarray nil)
(defvar web-mode-overlay-tag-start nil)
(defvar web-mode-overlay-tag-end nil)
(defvar web-mode-part-beg nil)
(defvar web-mode-scan-beg nil)
(defvar web-mode-scan-end nil)
(defvar web-mode-snippets nil)
(defvar web-mode-time nil)
(defvar web-mode-offsetless-elements
'())
(defvar web-mode-indentless-elements
'("code" "pre" "textarea"))
(defvar web-mode-indentless-attributes
'("onclick" "onmouseover" "onmouseout" "onsubmit"))
(defvar web-mode-void-elements
'("area" "base" "br" "col" "command" "embed" "hr" "img" "input" "keygen"
"link" "meta" "param" "source" "track" "wbr"))
(defvar web-mode-part-content-types
'("css" "javascript" "json" "jsx" "markdown" "pug" "ruby"
"sass" "sql" "stylus" "typescript"))
(defvar web-mode-javascript-languages '("javascript" "jsx" "ejs"))
;; NOTE: without 'syntax-table forward-word fails (#377)
(defvar web-mode-scan-properties
(list 'tag-beg 'tag-end 'tag-name 'tag-type
'tag-attr 'tag-attr-beg 'tag-attr-end
'part-side 'part-token
'jsx-beg 'jsx-end 'jsx-depth
'block-side 'block-token 'block-controls 'block-beg 'block-end
'syntax-table)
"Text properties used for code regions/tokens and html nodes.")
(defvar web-mode-start-tag-regexp "<\\([[:alpha:]][[:alnum:].:_-]*\\|>\\)"
"Regular expression for HTML/XML start tag.")
(defvar web-mode-tag-regexp "</?\\([[:alpha:]][[:alnum:].:_-]*\\)"
"Regular expression for HTML/XML tag.")
(defvar web-mode-dom-regexp "<\\(/?>\\|/?[[:alpha:]][[:alnum:].:_-]*\\|!--\\|!\\[CDATA\\[\\|!doctype\\|!DOCTYPE\\|\?xml\\)")
(defvar web-mode-whitespaces-regexp
"^[ \t]\\{2,\\}$\\| \t\\|\t \\|[ \t]+$\\|^[ \n\t]+\\'\\|^[ \t]?[\n]\\{2,\\}"
"Regular expression for whitespaces.")
(defvar web-mode-imenu-regexp-list
'(("<\\(h[1-9]\\)\\([^>]*\\)>\\([^<]*\\)" 1 3 ">")
("^[ \t]*<\\([@a-z]+\\)[^>]*>? *$" 1 "id=\"\\([a-zA-Z0-9_]+\\)\"" "#" ">"))
"Regexps to match imenu items (see http://web-mode.org/doc/imenu.txt)")
;; https://www.gnu.org/software/emacs/manual/html_node/ccmode/Syntactic-Symbols.html
(defvar web-mode-indentation-params
'(("lineup-args" . t)
("lineup-calls" . t)
("lineup-concats" . t)
("lineup-quotes" . t)
("lineup-ternary" . t)
("case-extra-offset" . t)
))
(defvar web-mode-engines
'(("angular" . ("angularjs"))
("archibus" . ())
("artanis" . ())
("asp" . ())
("aspx" . ())
("blade" . ("laravel"))
("cl-emb" . ())
("clip" . ())
("closure" . ("soy"))
("ctemplate" . ("mustache" "handlebars" "hapax" "ngtemplate" "ember"
"kite" "meteor" "blaze" "ractive" "velvet"))
("django" . ("dtl" "twig" "swig" "jinja" "jinja2" "erlydtl" "liquid"
"clabango" "selmer" "nunjucks"))
("dust" . ("dustjs"))
("ejs" . ())
("elixir" . ("phoenix"))
("erb" . ("eruby" "erubis"))
("expressionengine" . ("ee"))
("freemarker" . ())
("go" . ("gtl" "hugo"))
("hero" . ())
("json-t" . ())
("jsp" . ("grails"))
("mako" . ())
("marko" . ())
("mason" . ("poet"))
("lsp" . ("lisp"))
("mojolicious" . ())
("php" . ())
("python" . ())
("razor" . ("play" "play2"))
("riot" . ())
("smarty" . ())
("spip" . ())
("svelte" . ("svelte"))
("template-toolkit" . ())
("thymeleaf" . ())
("underscore" . ("underscore.js"))
("velocity" . ("vtl" "cheetah" "ssp"))
("vue" . ("vuejs" "vue.js"))
("web2py" . ())
("xoops" . ())
)
"Engine name aliases")
(defvar web-mode-content-types
'(("css" . "\\.\\(s?css\\|css\\.erb\\)\\'")
("javascript" . "\\.\\(js\\|js\\.erb\\)\\'")
("typescript" . "\\.\\(ts\\|ts\\.erb\\)\\'")
("json" . "\\.\\(api\\|json\\|jsonld\\)\\'")
("jsx" . "\\.[jt]sx\\'")
("xml" . "\\.xml\\'")
("html" . "."))
"content types")
(defvar web-mode-engine-attr-regexps
'(("angular" . "ng-")
("thymeleaf" . "th:")
("vue" . "v-"))
"Engine custom attributes")
(defvar web-mode-engine-attr-regexp
"^ng[-]\\|^th[:]\\|^v[-]\\|^[@:#(\[*]"
"Engine custom attributes")
(defvar web-mode-last-enabled-feature nil)
(defvar web-mode-features
'(("css-colorization" . web-mode-enable-css-colorization)
("element-highlight" . web-mode-enable-current-element-highlight)
("column-highlight" . web-mode-enable-current-column-highlight)
("whitespace-fontification" . web-mode-enable-whitespace-fontification)
("element-tag-fontification" . web-mode-enable-element-tag-fontification)
("block-face" . web-mode-enable-block-face)
("part-face" . web-mode-enable-part-face)))
(defvar web-mode-comment-prefixing t)
(defvar web-mode-engine-file-regexps
'(("angular" . "\\.component.html\\'")
("archibus" . "\\.axvw\\'")
("artanis" . "\\.html\\.tpl\\'")
("asp" . "\\.asp\\'")
("aspx" . "\\.as[cp]x\\'")
("blade" . "\\.blade\\.php\\'")
("cl-emb" . "\\.clemb\\'")
("clip" . "\\.ctml\\'")
("closure" . "\\.soy\\'")
("ctemplate" . "\\.\\(chtml\\|mustache\\)\\'")
("django" . "\\.\\(djhtml\\|tmpl\\|dtl\\|liquid\\|j2\\|njk\\)\\'")
("dust" . "\\.dust\\'")
("elixir" . "\\.l?eex\\'")
("ejs" . "\\.ejs\\'")
("erb" . "\\.\\(erb\\|rhtml\\|erb\\.html\\)\\'")
("expressionengine" . "\\.ee\\'")
("freemarker" . "\\.ftl\\'")
("go" . "\\.go\\(html\\|tmpl\\)\\'")
("handlebars" . "\\.\\(hb\\.html\\|hbs\\)\\'")
("hero" . "\\.hero\\'")
("jinja" . "\\.jinja\\'")
("jsp" . "\\.[gj]sp\\'")
("lsp" . "\\.lsp\\'")
("mako" . "\\.mako?\\'")
("marko" . "\\.marko\\'")
("mason" . "\\.mas\\'")
("mojolicious" . "\\.epl?\\'")
("php" . "\\.\\(p[hs]p\\|ctp\\|inc\\)\\'")
("python" . "\\.pml\\'")
("razor" . "\\.\\(cs\\|vb\\)html\\|\\.razor\\'")
("riot" . "\\.tag\\'")
("smarty" . "\\.tpl\\'")
("svelte" . "\\.svelte\\'")
("template-toolkit" . "\\.tt.?\\'")
("thymeleaf" . "\\.thtml\\'")
("velocity" . "\\.v\\(sl\\|tl\\|m\\)\\'")
("vue" . "\\.vue\\'")
("xoops" . "\\.xoops'")
;; regexp on the path, not just the extension
("django" . "[st]wig")
("razor" . "scala")
("spip" . "spip")
)
"Engine file extensions.")
(defvar web-mode-content-types-alist nil
"A list of filename patterns and corresponding web-mode content types. For example,
(setq web-mode-content-types-alist
'((\"json\" . \"/some/path/.*\\.api\\'\")
(\"jsx\" . \"/some/react/path/.*\\.js[x]?\\'\")))")
(defvar web-mode-engines-alist nil
"A list of filename patterns and corresponding web-mode engine. For example,
(setq web-mode-engines-alist
'((\"php\" . \"\\\\.phtml\\\\'\")
(\"blade\" . \"\\\\.blade\\\\.\")))")
(defvar web-mode-smart-quotes
'("«" . "»")
"Preferred smart quotes")
(defvar web-mode-xml-chars
'((?\& . "&amp;")
(?\< . "&lt;")
(?\> . "&gt;"))
"XML chars")
(defvar web-mode-html-entities
;; #985
;; remove ("gt" . 62) ("lt" . 60) ("amp" . 38)
'(("AElig" . 198) ("Aacute" . 193) ("Acirc" . 194) ("Agrave" . 192)
("Alpha" . 913) ("Aring" . 197) ("Atilde" . 195) ("Auml" . 196)
("Beta" . 914)
("Ccedil" . 199) ("Chi" . 935)
("Dagger" . 8225) ("Delta" . 916)
("ETH" . 208) ("Eacute" . 201) ("Ecirc" . 202) ("Egrave" . 200)
("Epsilon" . 917) ("Eta" . 919) ("Euml" . 203)
("Gamma" . 915)
("Iacute" . 205) ("Icirc" . 206) ("Igrave" . 204) ("Iota" . 921)
("Iuml" . 207)
("Kappa" . 922)
("Lambda" . 923)
("Mu" . 924)
("Ntilde" . 209) ("Nu" . 925)
("OElig" . 338) ("Oacute" . 211) ("Ocirc" . 212) ("Ograve" . 210)
("Omega" . 937) ("Omicron" . 927) ("Oslash" . 216) ("Otilde" . 213)
("Ouml" . 214)
("Phi" . 934) ("Pi" . 928) ("Prime" . 8243) ("Psi" . 936)
("Rho" . 929)
("Scaron" . 352) ("Sigma" . 931)
("THORN" . 222) ("Tau" . 932) ("Theta" . 920)
("UArr" . 8657) ("Uacute" . 218) ("Uacute" . 250) ("Ucirc" . 219)
("Ugrave" . 217) ("Upsih" . 978)
("Upsilon" . 933) ("Uuml" . 220) ("Uuml" . 252)
("Xi" . 926)
("Yacute" . 221) ("Yuml" . 376)
("Zeta" . 918)
("aacute" . 225) ("acirc" . 226) ("acute" . 180) ("aelig" . 230)
("agrave" . 224) ("alefsym" . 8501) ("alpha" . 945)
("ang" . 8736) ("apos" . 39) ("aring" . 229) ("asymp" . 8776)
("atilde" . 227) ("auml" . 228)
("bdquo" . 8222) ("beta" . 946) ("brvbar" . 166) ("bull" . 8226)
("cap" . 8745) ("ccedil" . 231) ("cedil" . 184) ("cent" . 162)
("chi" . 967) ("circ" . 710) ("clubs" . 9827) ("cong" . 8773)
("copy" . 169) ("crarr" . 8629) ("cup" . 8746) ("curren" . 164)
("dArr" . 8659) ("dagger" . 8224) ("darr" . 8595) ("deg" . 176)
("delta" . 948) ("diams" . 9830) ("divide" . 247)
("eacute" . 233) ("ecirc" . 234) ("egrave" . 232) ("empty" . 8709)
("emsp" . 8195) ("ensp" . 8194) ("epsilon" . 949) ("equiv" . 8801)
("eta" . 951) ("eth" . 240) ("euml" . 235) ("euro" . 8364) ("exist" . 8707)
("fnof" . 402) ("forall" . 8704) ("frac12" . 189) ("frac14" . 188)
("frac34" . 190) ("frasl" . 8260)
("gamma" . 947) ("ge" . 8805)
("hArr" . 8660) ("harr" . 8596) ("hearts" . 9829) ("hellip" . 8230)
("iacute" . 237) ("icirc" . 238) ("iexcl" . 161) ("igrave" . 236)
("image" . 8465) ("infin" . 8734) ("int" . 8747) ("iota" . 953)
("iquest" . 191) ("isin" . 8712) ("iuml" . 239)
("kappa" . 954)
("lArr" . 8656) ("lambda" . 955) ("lang" . 9001) ("laquo" . 171)
("larr" . 8592) ("lceil" . 8968) ("ldquo" . 8220) ("le" . 8804)
("lfloor" . 8970) ("lowast" . 8727) ("loz" . 9674) ("lrm" . 8206)
("lsaquo" . 8249) ("lsquo" . 8249)
("macr" . 175) ("mdash" . 8212) ("micro" . 181) ("middot" . 183)
("minus" . 8722) ("mu" . 956)
("nabla" . 8711) ("nbsp" . 160) ("ndash" . 8211) ("ne" . 8800)
("ni" . 8715) ("not" . 172) ("notin" . 8713) ("nsub" . 8836)
("ntilde" . 241) ("nu" . 957) ("oacute" . 243) ("ocirc" . 244)
("oelig" . 339) ("ograve" . 242) ("oline" . 8254) ("omega" . 969)