forked from fxbois/web-mode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
web-mode.el
12959 lines (11868 loc) · 464 KB
/
web-mode.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
;;; web-mode.el --- major mode for editing web templates
;;; -*- coding: utf-8 -*-
;; Copyright 2011-2017 François-Xavier Bois
;; Version: 15.0.3
;; 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 DigitalFactory & DataLab in Paris
;;==============================================================================
;;; Code:
;;---- CONSTS ------------------------------------------------------------------
(defconst web-mode-version "15.0.3"
"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-script-padding 1
"Script element left padding."
:type 'integer
:group 'web-mode)
(defcustom web-mode-style-padding 1
"Style element left padding."
:type 'integer
:group 'web-mode)
(defcustom web-mode-block-padding 0
"Multi-line block (php, ruby, java, python, asp, etc.) left padding."
:type 'integer
:group 'web-mode)
(defcustom web-mode-attr-indent-offset nil
"Html attribute indentation level."
:type 'integer
:safe #'integerp
:group 'web-mode)
(defcustom web-mode-attr-value-indent-offset nil
"Html attribute value indentation level."
:type 'integer
:safe #'integerp
: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-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
"Disable 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-comment-interpolation t
"Enable highlight of keywords like FIXME, TODO, etc. in comments."
:type 'list
: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-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-engine-detection nil
"Detect such directive -*- engine: ENGINE -*- at the top of the file."
: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)))
(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)))
(defcustom web-mode-extra-expanders '()
"A list of additional expanders."
:type 'list
:group 'web-mode)
(defcustom web-mode-extra-auto-pairs '()
"A list of additional snippets."
:type 'list
:group 'web-mode)
(defcustom web-mode-extra-snippets '()
"A list of additional snippets."
:type 'list
:group 'web-mode)
(defcustom web-mode-extra-builtins '()
"A list of additional builtins."
:type 'list
:group 'web-mode)
(defcustom web-mode-extra-constants '()
"A list of additional constants."
:type 'list
:group 'web-mode)
(defcustom web-mode-extra-keywords '()
"A list of additional keywords."
:type 'list
:group 'web-mode)
(defcustom web-mode-extra-types '()
"A list of additional types."
:type 'list
:group 'web-mode)
(defcustom web-mode-extra-control-blocks '()
"A list of additional control blocks."
:type 'list
:group 'web-mode)
(defcustom web-mode-tests-directory (concat default-directory "tests/")
"Directory containing all the unit tests."
:type 'list
: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)
"Each jsx depth has is own face."
:type 'list
: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)
;;---- 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."
: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-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-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-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. –, é)."
:group 'web-mode-faces)
(defface web-mode-jsx-depth-1-face
'((t :background "#333333"))
"jsx depth 1"
:group 'web-mode-faces)
(defface web-mode-jsx-depth-2-face
'((t :background "#222222"))
"jsx"
:group 'web-mode-faces)
(defface web-mode-jsx-depth-3-face
'((t :background "#111111"))
"jsx"
:group 'web-mode-faces)
(defface web-mode-jsx-depth-4-face
'((t :background "#000000"))
"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-inhibit-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-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" "sql" "stylus"))
(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-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)")
(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" "angular.js"))
("archibus" . ())
("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"))
("freemarker" . ())
("go" . ("gtl"))
("hero" . ())
("json-t" . ())
("jsp" . ("grails"))
("mako" . ())
("marko" . ())
("mason" . ("poet"))
("lsp" . ("lisp"))
("mojolicious" . ())
("php" . ())
("python" . ())
("razor" . ("play" "play2"))
("riot" . ())
("template-toolkit" . ())
("smarty" . ())
("thymeleaf" . ())
("underscore" . ("underscore.js"))
("velocity" . ("vtl" "cheetah" "ssp"))
("web2py" . ())
("xoops" . ())
)
"Engine name aliases")
(defvar web-mode-content-types
'(("css" . "\\.\\(s?css\\|css\\.erb\\)\\'")
("javascript" . "\\.\\([jt]s\\|[jt]s\\.erb\\)\\'")
("json" . "\\.\\(api\\|json\\|jsonld\\)\\'")
("jsx" . "\\.[jt]sx\\'")
("xml" . "\\.xml\\'")
("html" . "."))
"content types")
(defvar web-mode-engine-attr-regexps
'(("angular" . "ng-")
("thymeleaf" . "th:"))
"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-comment-formats
'(("java" . "/*")
("javascript" . "/*")
("php" . "/*")
))
(defvar web-mode-engine-file-regexps
'(("asp" . "\\.asp\\'")
("aspx" . "\\.as[cp]x\\'")
("archibus" . "\\.axvw\\'")
("blade" . "\\.blade\\.php\\'")
("cl-emb" . "\\.clemb\\'")
("clip" . "\\.ctml\\'")
("closure" . "\\.soy\\'")
("ctemplate" . "\\.\\(chtml\\|mustache\\)\\'")
("django" . "\\.\\(djhtml\\|tmpl\\|dtl\\|liquid\\|j2\\|njk\\)\\'")
("dust" . "\\.dust\\'")
("elixir" . "\\.eex\\'")
("ejs" . "\\.ejs\\'")
("erb" . "\\.\\(erb\\|rhtml\\|erb\\.html\\)\\'")
("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\\'")
("template-toolkit" . "\\.tt.?\\'")
("thymeleaf" . "\\.thtml\\'")
("velocity" . "\\.v\\(sl\\|tl\\|m\\)\\'")
("xoops" . "\\.xoops'")
("django" . "[st]wig")
("razor" . "scala")
)
"Engine file extensions.")
(defvar web-mode-engines-alist nil
"Alist 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
'((?\& . "&")
(?\< . "<")
(?\> . ">"))
"XML chars")
(defvar web-mode-html-entities
'(("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) ("amp" . 38)
("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) ("gt" . 62)
("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) ("lt" . 60)
("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)
("omicron" . 959) ("oplus" . 8853) ("or" . 8744) ("ordf" . 170)
("ordm" . 186) ("oslash" . 248) ("otilde" . 245) ("otimes" . 8855)
("ouml" . 246)
("para" . 182) ("part" . 8706) ("permil" . 8240) ("perp" . 8869)
("phi" . 966) ("pi" . 960) ("piv" . 982) ("plusmn" . 177) ("pound" . 163)
("prime" . 8242) ("prod" . 8719) ("prop" . 8733) ("psi" . 968)
("quot" . 34)
("rArr" . 8658) ("radic" . 8730) ("rang" . 9002) ("raquo" . 187)
("rarr" . 8594) ("rceil" . 8969) ("rdquo" . 8221) ("real" . 8476)
("reg" . 174) ("rfloor" . 8971) ("rho" . 961) ("rlm" . 8207)
("rsaquo" . 8250) ("rsquo" . 8250) ("sbquo" . 8218)
("scaron" . 353) ("sdot" . 8901) ("sect" . 167) ("shy" . 173)
("sigma" . 963) ("sigmaf" . 962) ("sim" . 8764) ("spades" . 9824)
("sub" . 8834) ("sube" . 8838) ("sum" . 8721) ("sup" . 8835)
("sup1" . 185) ("sup2" . 178) ("sup3" . 179) ("supe" . 8839)
("szlig" . 223)
("tau" . 964) ("there4" . 8756) ("theta" . 952) ("thetasym" . 977)
("thinsp" . 8201) ("thorn" . 254) ("tilde" . 732) ("times" . 215)
("trade" . 8482)
("uarr" . 8593) ("ucirc" . 251) ("ugrave" . 249) ("uml" . 168)
("upsilon" . 965)
("weierp" . 8472)
("xi" . 958)
("yacute" . 253) ("yen" . 165) ("yuml" . 255)
("zeta" . 950) ("zwj" . 8205) ("zwnj" . 8204)))
;; http://webdesign.about.com/od/localization/l/blhtmlcodes-ascii.htm
(defvar web-mode-display-table
(let ((table (make-display-table)))
(aset table 9 (vector ?\xBB ?\t))
(aset table 10 (vector ?\xB6 ?\n))
(aset table 32 (vector ?\xB7))
table)
"Display table used when switching to the whitespace visualization.")
(defvar web-mode-expanders
'(("a/" . "<a href=\"|\"></a>")
("b/" . "<table><tbody><tr><td>|</td><td></td></tr></tbody></table>")
("c/" . "<div class=\"|\"></div>")
("d/" . "<div>|</div>")
("e/" . "<em>|</em>")
("f/" . "<form>|</form>")
("g/" . "<strong>|</strong>")
("h/" . "<h1>|</h1>")
("i/" . "<img src=\"|\" />")
("j/" . "<script>|</script>")
("l/" . "<li>|</li>")
("m/" . "<main>|</main>")
("n/" . "<input type=\"|\" />")
("p/" . "<p>|</p>")
("q/" . "<quote>|</quote>")
("s/" . "<span>|</span>")
("t/" . "<td>|</td>")
("u/" . "<ul><li>|</li><li></li></ul>")
("x/" . "<textarea>|</textarea>")
("2/" . "<h2>|</h2>")
("3/" . "<h3>|</h3>")