-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhtml.lq
47 lines (37 loc) · 925 Bytes
/
html.lq
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
#import "css.lq"
SPACES "*[@space?]"
SPACES_ "*[@space]"
STRING_VALUE "*[ \\\" | ?![\"] @or?]"
STRING "\"?[ ?[@STRING_VALUE] @G]\""
TAG_NAME "*[-_a-zA-Z0-9]"
TAG_STYLE "style"
TAG_ATTR "?[?[@TAG_NAME]@G] ?[@SPACES] = ?[@SPACES] ?[?[@STRING]@G]"
TAG_ATTRS "*[ ?[@SPACES_] ?[ ?[@TAG_ATTR] @G] @or]"
TAG_CONTENT "
?[@SPACES]
*[
?[@HTML]
?[@SPACES]
@or?]
"
HTML_A "
< ?[@SPACES] ?[ ?[@TAG_NAME] @G] ?[@TAG_ATTRS?] ?[@SPACES] >
?[ ?[@TAG_CONTENT] @G]
</ ?[@SPACES] ?[1@BL] ?[@SPACES] >
"
STYLE_CONTENT "*[
?[@CSS]
?[@SPACES]
@or]"
HTML_STYLE "
< ?[@SPACES] ?[ ?[@TAG_STYLE] @G] ?[@TAG_ATTRS?] ?[@SPACES] >
?[@SPACES]
?[ ?[@STYLE_CONTENT] @G?]
?[@SPACES]
</ ?[@SPACES] ?[1@BL] ?[@SPACES] >
"
HTML_B "
< ?[@SPACES] ?[ ?[@TAG_NAME] @G] ?[ ?[@TAG_ATTRS?] @G] ?[@SPACES] / ?[@SPACES]>
"
HTML_C "*![ \t\n<]"
HTML "?[ ?[ ?[@HTML_STYLE] | ?[@HTML_A] | ?[@HTML_B] | ?[@HTML_C] @or] @G]"