aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/tdewolff/minify/v2/html
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/tdewolff/minify/v2/html')
-rw-r--r--vendor/github.com/tdewolff/minify/v2/html/buffer.go137
-rw-r--r--vendor/github.com/tdewolff/minify/v2/html/hash.go543
-rw-r--r--vendor/github.com/tdewolff/minify/v2/html/html.go514
-rw-r--r--vendor/github.com/tdewolff/minify/v2/html/table.go1346
4 files changed, 2540 insertions, 0 deletions
diff --git a/vendor/github.com/tdewolff/minify/v2/html/buffer.go b/vendor/github.com/tdewolff/minify/v2/html/buffer.go
new file mode 100644
index 0000000..f58367b
--- /dev/null
+++ b/vendor/github.com/tdewolff/minify/v2/html/buffer.go
@@ -0,0 +1,137 @@
1package html
2
3import (
4 "github.com/tdewolff/parse/v2"
5 "github.com/tdewolff/parse/v2/html"
6)
7
8// Token is a single token unit with an attribute value (if given) and hash of the data.
9type Token struct {
10 html.TokenType
11 Hash Hash
12 Data []byte
13 Text []byte
14 AttrVal []byte
15 Traits traits
16 Offset int
17}
18
19// TokenBuffer is a buffer that allows for token look-ahead.
20type TokenBuffer struct {
21 r *parse.Input
22 l *html.Lexer
23
24 buf []Token
25 pos int
26
27 attrBuffer []*Token
28}
29
30// NewTokenBuffer returns a new TokenBuffer.
31func NewTokenBuffer(r *parse.Input, l *html.Lexer) *TokenBuffer {
32 return &TokenBuffer{
33 r: r,
34 l: l,
35 buf: make([]Token, 0, 8),
36 }
37}
38
39func (z *TokenBuffer) read(t *Token) {
40 t.Offset = z.r.Offset()
41 t.TokenType, t.Data = z.l.Next()
42 t.Text = z.l.Text()
43 if t.TokenType == html.AttributeToken {
44 t.Offset += 1 + len(t.Text) + 1
45 t.AttrVal = z.l.AttrVal()
46 if len(t.AttrVal) > 1 && (t.AttrVal[0] == '"' || t.AttrVal[0] == '\'') {
47 t.Offset++
48 t.AttrVal = t.AttrVal[1 : len(t.AttrVal)-1] // quotes will be readded in attribute loop if necessary
49 }
50 t.Hash = ToHash(t.Text)
51 t.Traits = attrMap[t.Hash]
52 } else if t.TokenType == html.StartTagToken || t.TokenType == html.EndTagToken {
53 t.AttrVal = nil
54 t.Hash = ToHash(t.Text)
55 t.Traits = tagMap[t.Hash] // zero if not exist
56 } else {
57 t.AttrVal = nil
58 t.Hash = 0
59 t.Traits = 0
60 }
61}
62
63// Peek returns the ith element and possibly does an allocation.
64// Peeking past an error will panic.
65func (z *TokenBuffer) Peek(pos int) *Token {
66 pos += z.pos
67 if pos >= len(z.buf) {
68 if len(z.buf) > 0 && z.buf[len(z.buf)-1].TokenType == html.ErrorToken {
69 return &z.buf[len(z.buf)-1]
70 }
71
72 c := cap(z.buf)
73 d := len(z.buf) - z.pos
74 p := pos - z.pos + 1 // required peek length
75 var buf []Token
76 if 2*p > c {
77 buf = make([]Token, 0, 2*c+p)
78 } else {
79 buf = z.buf
80 }
81 copy(buf[:d], z.buf[z.pos:])
82
83 buf = buf[:p]
84 pos -= z.pos
85 for i := d; i < p; i++ {
86 z.read(&buf[i])
87 if buf[i].TokenType == html.ErrorToken {
88 buf = buf[:i+1]
89 pos = i
90 break
91 }
92 }
93 z.pos, z.buf = 0, buf
94 }
95 return &z.buf[pos]
96}
97
98// Shift returns the first element and advances position.
99func (z *TokenBuffer) Shift() *Token {
100 if z.pos >= len(z.buf) {
101 t := &z.buf[:1][0]
102 z.read(t)
103 return t
104 }
105 t := &z.buf[z.pos]
106 z.pos++
107 return t
108}
109
110// Attributes extracts the gives attribute hashes from a tag.
111// It returns in the same order pointers to the requested token data or nil.
112func (z *TokenBuffer) Attributes(hashes ...Hash) []*Token {
113 n := 0
114 for {
115 if t := z.Peek(n); t.TokenType != html.AttributeToken {
116 break
117 }
118 n++
119 }
120 if len(hashes) > cap(z.attrBuffer) {
121 z.attrBuffer = make([]*Token, len(hashes))
122 } else {
123 z.attrBuffer = z.attrBuffer[:len(hashes)]
124 for i := range z.attrBuffer {
125 z.attrBuffer[i] = nil
126 }
127 }
128 for i := z.pos; i < z.pos+n; i++ {
129 attr := &z.buf[i]
130 for j, hash := range hashes {
131 if hash == attr.Hash {
132 z.attrBuffer[j] = attr
133 }
134 }
135 }
136 return z.attrBuffer
137}
diff --git a/vendor/github.com/tdewolff/minify/v2/html/hash.go b/vendor/github.com/tdewolff/minify/v2/html/hash.go
new file mode 100644
index 0000000..3b91cbb
--- /dev/null
+++ b/vendor/github.com/tdewolff/minify/v2/html/hash.go
@@ -0,0 +1,543 @@
1package html
2
3// generated by hasher -type=Hash -file=hash.go; DO NOT EDIT, except for adding more constants to the list and rerun go generate
4
5// uses github.com/tdewolff/hasher
6//go:generate hasher -type=Hash -file=hash.go
7
8// Hash defines perfect hashes for a predefined list of strings
9type Hash uint32
10
11// Unique hash definitions to be used instead of strings
12const (
13 A Hash = 0x1 // a
14 Abbr Hash = 0x37a04 // abbr
15 About Hash = 0x5 // about
16 Accept Hash = 0x1106 // accept
17 Accept_Charset Hash = 0x110e // accept-charset
18 Action Hash = 0x23f06 // action
19 Address Hash = 0x5a07 // address
20 Align Hash = 0x32705 // align
21 Alink Hash = 0x7005 // alink
22 Allowfullscreen Hash = 0x2ad0f // allowfullscreen
23 Amp_Boilerplate Hash = 0x610f // amp-boilerplate
24 Area Hash = 0x1e304 // area
25 Article Hash = 0x2707 // article
26 Aside Hash = 0xb405 // aside
27 Async Hash = 0xac05 // async
28 Audio Hash = 0xd105 // audio
29 Autofocus Hash = 0xe409 // autofocus
30 Autoplay Hash = 0x10808 // autoplay
31 Axis Hash = 0x11004 // axis
32 B Hash = 0x101 // b
33 Background Hash = 0x300a // background
34 Base Hash = 0x19604 // base
35 Bb Hash = 0x37b02 // bb
36 Bdi Hash = 0x7503 // bdi
37 Bdo Hash = 0x31f03 // bdo
38 Bgcolor Hash = 0x12607 // bgcolor
39 Blockquote Hash = 0x13e0a // blockquote
40 Body Hash = 0xd04 // body
41 Br Hash = 0x37c02 // br
42 Button Hash = 0x14806 // button
43 Canvas Hash = 0xb006 // canvas
44 Caption Hash = 0x21f07 // caption
45 Charset Hash = 0x1807 // charset
46 Checked Hash = 0x1b307 // checked
47 Cite Hash = 0xfb04 // cite
48 Class Hash = 0x15905 // class
49 Classid Hash = 0x15907 // classid
50 Clear Hash = 0x2b05 // clear
51 Code Hash = 0x19204 // code
52 Codebase Hash = 0x19208 // codebase
53 Codetype Hash = 0x1a408 // codetype
54 Col Hash = 0x12803 // col
55 Colgroup Hash = 0x1bb08 // colgroup
56 Color Hash = 0x12805 // color
57 Cols Hash = 0x1cf04 // cols
58 Colspan Hash = 0x1cf07 // colspan
59 Compact Hash = 0x1ec07 // compact
60 Content Hash = 0x28407 // content
61 Controls Hash = 0x20108 // controls
62 Data Hash = 0x1f04 // data
63 Datalist Hash = 0x1f08 // datalist
64 Datatype Hash = 0x4d08 // datatype
65 Dd Hash = 0x5b02 // dd
66 Declare Hash = 0xb707 // declare
67 Default Hash = 0x7f07 // default
68 DefaultChecked Hash = 0x1730e // defaultChecked
69 DefaultMuted Hash = 0x7f0c // defaultMuted
70 DefaultSelected Hash = 0x8a0f // defaultSelected
71 Defer Hash = 0x9805 // defer
72 Del Hash = 0x10503 // del
73 Details Hash = 0x15f07 // details
74 Dfn Hash = 0x16c03 // dfn
75 Dialog Hash = 0xa606 // dialog
76 Dir Hash = 0x7603 // dir
77 Disabled Hash = 0x18008 // disabled
78 Div Hash = 0x18703 // div
79 Dl Hash = 0x1b902 // dl
80 Dt Hash = 0x23102 // dt
81 Em Hash = 0x4302 // em
82 Embed Hash = 0x4905 // embed
83 Enabled Hash = 0x26c07 // enabled
84 Enctype Hash = 0x1fa07 // enctype
85 Face Hash = 0x5604 // face
86 Fieldset Hash = 0x21408 // fieldset
87 Figcaption Hash = 0x21c0a // figcaption
88 Figure Hash = 0x22606 // figure
89 Footer Hash = 0xdb06 // footer
90 For Hash = 0x23b03 // for
91 Form Hash = 0x23b04 // form
92 Formaction Hash = 0x23b0a // formaction
93 Formnovalidate Hash = 0x2450e // formnovalidate
94 Frame Hash = 0x28c05 // frame
95 Frameborder Hash = 0x28c0b // frameborder
96 H1 Hash = 0x2e002 // h1
97 H2 Hash = 0x25302 // h2
98 H3 Hash = 0x25502 // h3
99 H4 Hash = 0x25702 // h4
100 H5 Hash = 0x25902 // h5
101 H6 Hash = 0x25b02 // h6
102 Head Hash = 0x2d204 // head
103 Header Hash = 0x2d206 // header
104 Hgroup Hash = 0x25d06 // hgroup
105 Hidden Hash = 0x26806 // hidden
106 Hr Hash = 0x32d02 // hr
107 Href Hash = 0x32d04 // href
108 Hreflang Hash = 0x32d08 // hreflang
109 Html Hash = 0x27304 // html
110 Http_Equiv Hash = 0x2770a // http-equiv
111 I Hash = 0x2401 // i
112 Icon Hash = 0x28304 // icon
113 Id Hash = 0xb602 // id
114 Iframe Hash = 0x28b06 // iframe
115 Img Hash = 0x29703 // img
116 Inert Hash = 0xf605 // inert
117 Inlist Hash = 0x29a06 // inlist
118 Input Hash = 0x2a405 // input
119 Ins Hash = 0x2a903 // ins
120 Ismap Hash = 0x11205 // ismap
121 Itemscope Hash = 0xfc09 // itemscope
122 Kbd Hash = 0x7403 // kbd
123 Keygen Hash = 0x1f606 // keygen
124 Label Hash = 0xbe05 // label
125 Lang Hash = 0x33104 // lang
126 Language Hash = 0x33108 // language
127 Legend Hash = 0x2c506 // legend
128 Li Hash = 0x2302 // li
129 Link Hash = 0x7104 // link
130 Longdesc Hash = 0xc208 // longdesc
131 Main Hash = 0xf404 // main
132 Manifest Hash = 0x2bc08 // manifest
133 Map Hash = 0xee03 // map
134 Mark Hash = 0x2cb04 // mark
135 Math Hash = 0x2cf04 // math
136 Max Hash = 0x2d803 // max
137 Maxlength Hash = 0x2d809 // maxlength
138 Media Hash = 0xa405 // media
139 Menu Hash = 0x12204 // menu
140 Meta Hash = 0x2e204 // meta
141 Meter Hash = 0x2f705 // meter
142 Method Hash = 0x2fc06 // method
143 Multiple Hash = 0x30208 // multiple
144 Muted Hash = 0x30a05 // muted
145 Name Hash = 0xa204 // name
146 Nav Hash = 0x32403 // nav
147 Nohref Hash = 0x32b06 // nohref
148 Noresize Hash = 0x13608 // noresize
149 Noscript Hash = 0x14d08 // noscript
150 Noshade Hash = 0x16e07 // noshade
151 Novalidate Hash = 0x2490a // novalidate
152 Nowrap Hash = 0x1d506 // nowrap
153 Object Hash = 0xd506 // object
154 Ol Hash = 0xcb02 // ol
155 Open Hash = 0x32104 // open
156 Optgroup Hash = 0x35608 // optgroup
157 Option Hash = 0x30f06 // option
158 Output Hash = 0x206 // output
159 P Hash = 0x501 // p
160 Param Hash = 0xf005 // param
161 Pauseonexit Hash = 0x1160b // pauseonexit
162 Picture Hash = 0x1c207 // picture
163 Plaintext Hash = 0x1da09 // plaintext
164 Poster Hash = 0x26206 // poster
165 Pre Hash = 0x35d03 // pre
166 Prefix Hash = 0x35d06 // prefix
167 Profile Hash = 0x36407 // profile
168 Progress Hash = 0x34208 // progress
169 Property Hash = 0x31508 // property
170 Q Hash = 0x14301 // q
171 Rb Hash = 0x2f02 // rb
172 Readonly Hash = 0x1e408 // readonly
173 Rel Hash = 0xbc03 // rel
174 Required Hash = 0x22a08 // required
175 Resource Hash = 0x1c708 // resource
176 Rev Hash = 0x7803 // rev
177 Reversed Hash = 0x7808 // reversed
178 Rows Hash = 0x9c04 // rows
179 Rowspan Hash = 0x9c07 // rowspan
180 Rp Hash = 0x6a02 // rp
181 Rt Hash = 0x2802 // rt
182 Rtc Hash = 0xf903 // rtc
183 Ruby Hash = 0xe004 // ruby
184 Rules Hash = 0x12c05 // rules
185 S Hash = 0x1c01 // s
186 Samp Hash = 0x6004 // samp
187 Scope Hash = 0x10005 // scope
188 Scoped Hash = 0x10006 // scoped
189 Script Hash = 0x14f06 // script
190 Scrolling Hash = 0xc809 // scrolling
191 Seamless Hash = 0x19808 // seamless
192 Section Hash = 0x13007 // section
193 Select Hash = 0x16506 // select
194 Selected Hash = 0x16508 // selected
195 Shape Hash = 0x19f05 // shape
196 Size Hash = 0x13a04 // size
197 Slot Hash = 0x20804 // slot
198 Small Hash = 0x2ab05 // small
199 Sortable Hash = 0x2ef08 // sortable
200 Source Hash = 0x1c906 // source
201 Span Hash = 0x9f04 // span
202 Src Hash = 0x34903 // src
203 Srcset Hash = 0x34906 // srcset
204 Start Hash = 0x2505 // start
205 Strong Hash = 0x29e06 // strong
206 Style Hash = 0x2c205 // style
207 Sub Hash = 0x31d03 // sub
208 Summary Hash = 0x33907 // summary
209 Sup Hash = 0x34003 // sup
210 Svg Hash = 0x34f03 // svg
211 Tabindex Hash = 0x2e408 // tabindex
212 Table Hash = 0x2f205 // table
213 Target Hash = 0x706 // target
214 Tbody Hash = 0xc05 // tbody
215 Td Hash = 0x1e02 // td
216 Template Hash = 0x4208 // template
217 Text Hash = 0x1df04 // text
218 Textarea Hash = 0x1df08 // textarea
219 Tfoot Hash = 0xda05 // tfoot
220 Th Hash = 0x2d102 // th
221 Thead Hash = 0x2d105 // thead
222 Time Hash = 0x12004 // time
223 Title Hash = 0x15405 // title
224 Tr Hash = 0x1f202 // tr
225 Track Hash = 0x1f205 // track
226 Translate Hash = 0x20b09 // translate
227 Truespeed Hash = 0x23209 // truespeed
228 Type Hash = 0x5104 // type
229 Typemustmatch Hash = 0x1a80d // typemustmatch
230 Typeof Hash = 0x5106 // typeof
231 U Hash = 0x301 // u
232 Ul Hash = 0x8302 // ul
233 Undeterminate Hash = 0x370d // undeterminate
234 Usemap Hash = 0xeb06 // usemap
235 Valign Hash = 0x32606 // valign
236 Value Hash = 0x18905 // value
237 Valuetype Hash = 0x18909 // valuetype
238 Var Hash = 0x28003 // var
239 Video Hash = 0x35205 // video
240 Visible Hash = 0x36b07 // visible
241 Vlink Hash = 0x37205 // vlink
242 Vocab Hash = 0x37705 // vocab
243 Wbr Hash = 0x37e03 // wbr
244 Xmlns Hash = 0x2eb05 // xmlns
245 Xmp Hash = 0x36203 // xmp
246)
247
248// String returns the hash' name.
249func (i Hash) String() string {
250 start := uint32(i >> 8)
251 n := uint32(i & 0xff)
252 if start+n > uint32(len(_Hash_text)) {
253 return ""
254 }
255 return _Hash_text[start : start+n]
256}
257
258// ToHash returns the hash whose name is s. It returns zero if there is no
259// such hash. It is case sensitive.
260func ToHash(s []byte) Hash {
261 if len(s) == 0 || len(s) > _Hash_maxLen {
262 return 0
263 }
264 h := uint32(_Hash_hash0)
265 for i := 0; i < len(s); i++ {
266 h ^= uint32(s[i])
267 h *= 16777619
268 }
269 if i := _Hash_table[h&uint32(len(_Hash_table)-1)]; int(i&0xff) == len(s) {
270 t := _Hash_text[i>>8 : i>>8+i&0xff]
271 for i := 0; i < len(s); i++ {
272 if t[i] != s[i] {
273 goto NEXT
274 }
275 }
276 return i
277 }
278NEXT:
279 if i := _Hash_table[(h>>16)&uint32(len(_Hash_table)-1)]; int(i&0xff) == len(s) {
280 t := _Hash_text[i>>8 : i>>8+i&0xff]
281 for i := 0; i < len(s); i++ {
282 if t[i] != s[i] {
283 return 0
284 }
285 }
286 return i
287 }
288 return 0
289}
290
291const _Hash_hash0 = 0x9acb0442
292const _Hash_maxLen = 15
293const _Hash_text = "aboutputargetbodyaccept-charsetdatalistarticlearbackgroundet" +
294 "erminatemplatembedatatypeofaceaddressamp-boilerplatealinkbdi" +
295 "reversedefaultMutedefaultSelectedeferowspanamedialogasyncanv" +
296 "asideclarelabelongdescrollingaudiobjectfooterubyautofocusema" +
297 "paramainertcitemscopedelautoplayaxismapauseonexitimenubgcolo" +
298 "rulesectionoresizeblockquotebuttonoscriptitleclassidetailsel" +
299 "ectedfnoshadefaultCheckedisabledivaluetypecodebaseamlesshape" +
300 "codetypemustmatcheckedlcolgroupicturesourcecolspanowraplaint" +
301 "extareadonlycompactrackeygenctypecontrolslotranslatefieldset" +
302 "figcaptionfigurequiredtruespeedformactionformnovalidateh2h3h" +
303 "4h5h6hgrouposterhiddenabledhtmlhttp-equivaricontentiframebor" +
304 "derimginlistronginputinsmallowfullscreenmanifestylegendmarkm" +
305 "atheadermaxlength1metabindexmlnsortablemetermethodmultiplemu" +
306 "tedoptionpropertysubdopenavalignohreflanguagesummarysuprogre" +
307 "ssrcsetsvgvideoptgrouprefixmprofilevisiblevlinkvocabbrwbr"
308
309var _Hash_table = [1 << 9]Hash{
310 0x0: 0x1df08, // textarea
311 0x4: 0x32d02, // hr
312 0x8: 0x1c207, // picture
313 0xb: 0x18905, // value
314 0xf: 0x2e408, // tabindex
315 0x12: 0x15905, // class
316 0x15: 0x37e03, // wbr
317 0x18: 0x1a80d, // typemustmatch
318 0x1a: 0x1b902, // dl
319 0x1d: 0xf903, // rtc
320 0x1e: 0x25702, // h4
321 0x22: 0x2ef08, // sortable
322 0x24: 0x4208, // template
323 0x25: 0x28c0b, // frameborder
324 0x28: 0x37a04, // abbr
325 0x29: 0x28b06, // iframe
326 0x2a: 0x610f, // amp-boilerplate
327 0x2c: 0x1e408, // readonly
328 0x30: 0x23f06, // action
329 0x33: 0x28c05, // frame
330 0x35: 0x12c05, // rules
331 0x36: 0x30208, // multiple
332 0x38: 0x31f03, // bdo
333 0x39: 0x1d506, // nowrap
334 0x3e: 0x21408, // fieldset
335 0x3f: 0x7503, // bdi
336 0x46: 0x7f0c, // defaultMuted
337 0x49: 0x35205, // video
338 0x4c: 0x19808, // seamless
339 0x4d: 0x13608, // noresize
340 0x4f: 0xb602, // id
341 0x51: 0x25d06, // hgroup
342 0x52: 0x23102, // dt
343 0x55: 0x12805, // color
344 0x56: 0x34003, // sup
345 0x59: 0x370d, // undeterminate
346 0x5a: 0x35608, // optgroup
347 0x5b: 0x2d206, // header
348 0x5c: 0xb405, // aside
349 0x5f: 0x10005, // scope
350 0x60: 0x101, // b
351 0x61: 0xcb02, // ol
352 0x64: 0x32b06, // nohref
353 0x65: 0x1da09, // plaintext
354 0x66: 0x20804, // slot
355 0x67: 0x11004, // axis
356 0x68: 0x12803, // col
357 0x69: 0x32606, // valign
358 0x6c: 0x2d105, // thead
359 0x70: 0x34906, // srcset
360 0x71: 0x26806, // hidden
361 0x76: 0x1bb08, // colgroup
362 0x78: 0x34f03, // svg
363 0x7b: 0x2cb04, // mark
364 0x7e: 0x33104, // lang
365 0x81: 0x1cf04, // cols
366 0x86: 0x5a07, // address
367 0x8b: 0xf404, // main
368 0x8c: 0x4302, // em
369 0x8f: 0x32d08, // hreflang
370 0x93: 0x1b307, // checked
371 0x94: 0x25902, // h5
372 0x95: 0x301, // u
373 0x96: 0x32705, // align
374 0x97: 0x14301, // q
375 0x99: 0xd506, // object
376 0x9b: 0x28407, // content
377 0x9d: 0xc809, // scrolling
378 0x9f: 0x36407, // profile
379 0xa0: 0x34903, // src
380 0xa1: 0xda05, // tfoot
381 0xa3: 0x2f705, // meter
382 0xa4: 0x37705, // vocab
383 0xa6: 0xd04, // body
384 0xa8: 0x19204, // code
385 0xac: 0x20108, // controls
386 0xb0: 0x2ab05, // small
387 0xb1: 0x18008, // disabled
388 0xb5: 0x5604, // face
389 0xb6: 0x501, // p
390 0xb9: 0x2302, // li
391 0xbb: 0xe409, // autofocus
392 0xbf: 0x27304, // html
393 0xc2: 0x4d08, // datatype
394 0xc6: 0x35d06, // prefix
395 0xcb: 0x35d03, // pre
396 0xcc: 0x1106, // accept
397 0xd1: 0x23b03, // for
398 0xd5: 0x29e06, // strong
399 0xd6: 0x9c07, // rowspan
400 0xd7: 0x25502, // h3
401 0xd8: 0x2cf04, // math
402 0xde: 0x16e07, // noshade
403 0xdf: 0x19f05, // shape
404 0xe1: 0x10006, // scoped
405 0xe3: 0x706, // target
406 0xe6: 0x21c0a, // figcaption
407 0xe9: 0x1df04, // text
408 0xea: 0x1c708, // resource
409 0xec: 0xee03, // map
410 0xf0: 0x29a06, // inlist
411 0xf1: 0x16506, // select
412 0xf2: 0x1f606, // keygen
413 0xf3: 0x5106, // typeof
414 0xf6: 0xb006, // canvas
415 0xf7: 0x30f06, // option
416 0xf8: 0xbe05, // label
417 0xf9: 0xbc03, // rel
418 0xfb: 0x1f04, // data
419 0xfd: 0x6004, // samp
420 0x100: 0x110e, // accept-charset
421 0x101: 0xeb06, // usemap
422 0x103: 0x2bc08, // manifest
423 0x109: 0xa204, // name
424 0x10a: 0x14806, // button
425 0x10b: 0x2b05, // clear
426 0x10e: 0x33907, // summary
427 0x10f: 0x2e204, // meta
428 0x110: 0x33108, // language
429 0x112: 0x300a, // background
430 0x113: 0x2707, // article
431 0x116: 0x23b0a, // formaction
432 0x119: 0x1, // a
433 0x11b: 0x5, // about
434 0x11c: 0xfc09, // itemscope
435 0x11e: 0x14d08, // noscript
436 0x11f: 0x15907, // classid
437 0x120: 0x36203, // xmp
438 0x121: 0x19604, // base
439 0x123: 0x1c01, // s
440 0x124: 0x36b07, // visible
441 0x126: 0x37b02, // bb
442 0x127: 0x9c04, // rows
443 0x12d: 0x2450e, // formnovalidate
444 0x131: 0x1f205, // track
445 0x135: 0x18703, // div
446 0x136: 0xac05, // async
447 0x137: 0x31508, // property
448 0x13a: 0x16c03, // dfn
449 0x13e: 0xf605, // inert
450 0x142: 0x10503, // del
451 0x144: 0x25302, // h2
452 0x147: 0x2c205, // style
453 0x149: 0x29703, // img
454 0x14a: 0xc05, // tbody
455 0x14b: 0x7603, // dir
456 0x14c: 0x2eb05, // xmlns
457 0x14e: 0x1f08, // datalist
458 0x14f: 0x32d04, // href
459 0x150: 0x1f202, // tr
460 0x151: 0x13e0a, // blockquote
461 0x152: 0x18909, // valuetype
462 0x155: 0xdb06, // footer
463 0x157: 0x14f06, // script
464 0x158: 0x1cf07, // colspan
465 0x15d: 0x1730e, // defaultChecked
466 0x15f: 0x2490a, // novalidate
467 0x164: 0x1a408, // codetype
468 0x165: 0x2c506, // legend
469 0x16b: 0x1160b, // pauseonexit
470 0x16c: 0x21f07, // caption
471 0x16f: 0x26c07, // enabled
472 0x173: 0x26206, // poster
473 0x175: 0x30a05, // muted
474 0x176: 0x11205, // ismap
475 0x178: 0x2a903, // ins
476 0x17a: 0xe004, // ruby
477 0x17b: 0x37c02, // br
478 0x17c: 0x8a0f, // defaultSelected
479 0x17d: 0x7403, // kbd
480 0x17f: 0x1c906, // source
481 0x182: 0x9f04, // span
482 0x184: 0x2d803, // max
483 0x18a: 0x5b02, // dd
484 0x18b: 0x13a04, // size
485 0x18c: 0xa405, // media
486 0x18d: 0x19208, // codebase
487 0x18f: 0x4905, // embed
488 0x192: 0x5104, // type
489 0x193: 0xf005, // param
490 0x194: 0x25b02, // h6
491 0x197: 0x28304, // icon
492 0x198: 0x12607, // bgcolor
493 0x199: 0x2ad0f, // allowfullscreen
494 0x19a: 0x12004, // time
495 0x19b: 0x7803, // rev
496 0x19d: 0x34208, // progress
497 0x19e: 0x22606, // figure
498 0x1a0: 0x6a02, // rp
499 0x1a2: 0xa606, // dialog
500 0x1a4: 0x2802, // rt
501 0x1a7: 0x1e304, // area
502 0x1a8: 0x7808, // reversed
503 0x1aa: 0x32104, // open
504 0x1ac: 0x2d204, // head
505 0x1ad: 0x7005, // alink
506 0x1af: 0x28003, // var
507 0x1b0: 0x15f07, // details
508 0x1b1: 0x2401, // i
509 0x1b3: 0x1e02, // td
510 0x1b4: 0xb707, // declare
511 0x1b5: 0x8302, // ul
512 0x1ba: 0x2fc06, // method
513 0x1bd: 0x13007, // section
514 0x1be: 0x22a08, // required
515 0x1c2: 0x9805, // defer
516 0x1c3: 0x37205, // vlink
517 0x1c4: 0x15405, // title
518 0x1c5: 0x2770a, // http-equiv
519 0x1c6: 0x1fa07, // enctype
520 0x1c7: 0x1ec07, // compact
521 0x1c8: 0x2d809, // maxlength
522 0x1c9: 0x16508, // selected
523 0x1cc: 0xd105, // audio
524 0x1cd: 0xc208, // longdesc
525 0x1d1: 0xfb04, // cite
526 0x1da: 0x2505, // start
527 0x1de: 0x2d102, // th
528 0x1df: 0x10808, // autoplay
529 0x1e2: 0x7104, // link
530 0x1e3: 0x206, // output
531 0x1e5: 0x12204, // menu
532 0x1e6: 0x2a405, // input
533 0x1eb: 0x32403, // nav
534 0x1ec: 0x31d03, // sub
535 0x1ee: 0x1807, // charset
536 0x1ef: 0x7f07, // default
537 0x1f3: 0x2f205, // table
538 0x1f4: 0x23b04, // form
539 0x1f5: 0x23209, // truespeed
540 0x1f6: 0x2f02, // rb
541 0x1fb: 0x20b09, // translate
542 0x1fd: 0x2e002, // h1
543}
diff --git a/vendor/github.com/tdewolff/minify/v2/html/html.go b/vendor/github.com/tdewolff/minify/v2/html/html.go
new file mode 100644
index 0000000..616a9ba
--- /dev/null
+++ b/vendor/github.com/tdewolff/minify/v2/html/html.go
@@ -0,0 +1,514 @@
1// Package html minifies HTML5 following the specifications at http://www.w3.org/TR/html5/syntax.html.
2package html
3
4import (
5 "bytes"
6 "io"
7
8 "github.com/tdewolff/minify/v2"
9 "github.com/tdewolff/parse/v2"
10 "github.com/tdewolff/parse/v2/buffer"
11 "github.com/tdewolff/parse/v2/html"
12)
13
14var (
15 gtBytes = []byte(">")
16 isBytes = []byte("=")
17 spaceBytes = []byte(" ")
18 doctypeBytes = []byte("<!doctype html>")
19 jsMimeBytes = []byte("application/javascript")
20 cssMimeBytes = []byte("text/css")
21 htmlMimeBytes = []byte("text/html")
22 svgMimeBytes = []byte("image/svg+xml")
23 formMimeBytes = []byte("application/x-www-form-urlencoded")
24 mathMimeBytes = []byte("application/mathml+xml")
25 dataSchemeBytes = []byte("data:")
26 jsSchemeBytes = []byte("javascript:")
27 httpBytes = []byte("http")
28 radioBytes = []byte("radio")
29 onBytes = []byte("on")
30 textBytes = []byte("text")
31 noneBytes = []byte("none")
32 submitBytes = []byte("submit")
33 allBytes = []byte("all")
34 rectBytes = []byte("rect")
35 dataBytes = []byte("data")
36 getBytes = []byte("get")
37 autoBytes = []byte("auto")
38 oneBytes = []byte("one")
39 inlineParams = map[string]string{"inline": "1"}
40)
41
42////////////////////////////////////////////////////////////////
43
44// Minifier is an HTML minifier.
45type Minifier struct {
46 KeepComments bool
47 KeepConditionalComments bool
48 KeepDefaultAttrVals bool
49 KeepDocumentTags bool
50 KeepEndTags bool
51 KeepQuotes bool
52 KeepWhitespace bool
53}
54
55// Minify minifies HTML data, it reads from r and writes to w.
56func Minify(m *minify.M, w io.Writer, r io.Reader, params map[string]string) error {
57 return (&Minifier{}).Minify(m, w, r, params)
58}
59
60// Minify minifies HTML data, it reads from r and writes to w.
61func (o *Minifier) Minify(m *minify.M, w io.Writer, r io.Reader, _ map[string]string) error {
62 var rawTagHash Hash
63 var rawTagMediatype []byte
64
65 omitSpace := true // if true the next leading space is omitted
66 inPre := false
67
68 attrMinifyBuffer := buffer.NewWriter(make([]byte, 0, 64))
69 attrByteBuffer := make([]byte, 0, 64)
70
71 z := parse.NewInput(r)
72 defer z.Restore()
73
74 l := html.NewLexer(z)
75 tb := NewTokenBuffer(z, l)
76 for {
77 t := *tb.Shift()
78 switch t.TokenType {
79 case html.ErrorToken:
80 if _, err := w.Write(nil); err != nil {
81 return err
82 }
83 if l.Err() == io.EOF {
84 return nil
85 }
86 return l.Err()
87 case html.DoctypeToken:
88 w.Write(doctypeBytes)
89 case html.CommentToken:
90 if o.KeepComments {
91 w.Write(t.Data)
92 } else if o.KeepConditionalComments && 6 < len(t.Text) && (bytes.HasPrefix(t.Text, []byte("[if ")) || bytes.HasSuffix(t.Text, []byte("[endif]")) || bytes.HasSuffix(t.Text, []byte("[endif]--"))) {
93 // [if ...] is always 7 or more characters, [endif] is only encountered for downlevel-revealed
94 // see https://msdn.microsoft.com/en-us/library/ms537512(v=vs.85).aspx#syntax
95 if bytes.HasPrefix(t.Data, []byte("<!--[if ")) && bytes.HasSuffix(t.Data, []byte("<![endif]-->")) { // downlevel-hidden
96 begin := bytes.IndexByte(t.Data, '>') + 1
97 end := len(t.Data) - len("<![endif]-->")
98 w.Write(t.Data[:begin])
99 if err := o.Minify(m, w, buffer.NewReader(t.Data[begin:end]), nil); err != nil {
100 return minify.UpdateErrorPosition(err, z, t.Offset)
101 }
102 w.Write(t.Data[end:])
103 } else {
104 w.Write(t.Data) // downlevel-revealed or short downlevel-hidden
105 }
106 } else if 1 < len(t.Text) && t.Text[0] == '#' {
107 // SSI tags
108 w.Write(t.Data)
109 }
110 case html.SvgToken:
111 if err := m.MinifyMimetype(svgMimeBytes, w, buffer.NewReader(t.Data), nil); err != nil {
112 if err != minify.ErrNotExist {
113 return minify.UpdateErrorPosition(err, z, t.Offset)
114 }
115 w.Write(t.Data)
116 }
117 case html.MathToken:
118 if err := m.MinifyMimetype(mathMimeBytes, w, buffer.NewReader(t.Data), nil); err != nil {
119 if err != minify.ErrNotExist {
120 return minify.UpdateErrorPosition(err, z, t.Offset)
121 }
122 w.Write(t.Data)
123 }
124 case html.TextToken:
125 // CSS and JS minifiers for inline code
126 if rawTagHash != 0 {
127 if rawTagHash == Style || rawTagHash == Script || rawTagHash == Iframe {
128 var mimetype []byte
129 var params map[string]string
130 if rawTagHash == Iframe {
131 mimetype = htmlMimeBytes
132 } else if len(rawTagMediatype) > 0 {
133 mimetype, params = parse.Mediatype(rawTagMediatype)
134 } else if rawTagHash == Script {
135 mimetype = jsMimeBytes
136 } else if rawTagHash == Style {
137 mimetype = cssMimeBytes
138 }
139 if err := m.MinifyMimetype(mimetype, w, buffer.NewReader(t.Data), params); err != nil {
140 if err != minify.ErrNotExist {
141 return minify.UpdateErrorPosition(err, z, t.Offset)
142 }
143 w.Write(t.Data)
144 }
145 } else {
146 w.Write(t.Data)
147 }
148 } else if inPre {
149 w.Write(t.Data)
150 } else {
151 t.Data = parse.ReplaceMultipleWhitespaceAndEntities(t.Data, EntitiesMap, TextRevEntitiesMap)
152
153 // whitespace removal; trim left
154 if omitSpace && parse.IsWhitespace(t.Data[0]) {
155 t.Data = t.Data[1:]
156 }
157
158 // whitespace removal; trim right
159 omitSpace = false
160 if len(t.Data) == 0 {
161 omitSpace = true
162 } else if parse.IsWhitespace(t.Data[len(t.Data)-1]) {
163 omitSpace = true
164 i := 0
165 for {
166 next := tb.Peek(i)
167 // trim if EOF, text token with leading whitespace or block token
168 if next.TokenType == html.ErrorToken {
169 t.Data = t.Data[:len(t.Data)-1]
170 omitSpace = false
171 break
172 } else if next.TokenType == html.TextToken {
173 // this only happens when a comment, doctype or phrasing end tag (only for !o.KeepWhitespace) was in between
174 // remove if the text token starts with a whitespace
175 if len(next.Data) > 0 && parse.IsWhitespace(next.Data[0]) {
176 t.Data = t.Data[:len(t.Data)-1]
177 omitSpace = false
178 }
179 break
180 } else if next.TokenType == html.StartTagToken || next.TokenType == html.EndTagToken {
181 if o.KeepWhitespace {
182 break
183 }
184 // remove when followed up by a block tag
185 if next.Traits&nonPhrasingTag != 0 {
186 t.Data = t.Data[:len(t.Data)-1]
187 omitSpace = false
188 break
189 } else if next.TokenType == html.StartTagToken {
190 break
191 }
192 }
193 i++
194 }
195 }
196
197 w.Write(t.Data)
198 }
199 case html.StartTagToken, html.EndTagToken:
200 rawTagHash = 0
201 hasAttributes := false
202 if t.TokenType == html.StartTagToken {
203 if next := tb.Peek(0); next.TokenType == html.AttributeToken {
204 hasAttributes = true
205 }
206 if t.Traits&rawTag != 0 {
207 // ignore empty script and style tags
208 if !hasAttributes && (t.Hash == Script || t.Hash == Style) {
209 if next := tb.Peek(1); next.TokenType == html.EndTagToken {
210 tb.Shift()
211 tb.Shift()
212 break
213 }
214 }
215 rawTagHash = t.Hash
216 rawTagMediatype = nil
217
218 // do not minify content of <style amp-boilerplate>
219 if hasAttributes && t.Hash == Style {
220 if attrs := tb.Attributes(Amp_Boilerplate); attrs[0] != nil {
221 rawTagHash = 0
222 }
223 }
224 }
225 } else if t.Hash == Template {
226 omitSpace = true // EndTagToken
227 }
228
229 if t.Hash == Pre {
230 inPre = t.TokenType == html.StartTagToken
231 }
232
233 // remove superfluous tags, except for html, head and body tags when KeepDocumentTags is set
234 if !hasAttributes && (!o.KeepDocumentTags && (t.Hash == Html || t.Hash == Head || t.Hash == Body) || t.Hash == Colgroup) {
235 break
236 } else if t.TokenType == html.EndTagToken {
237 omitEndTag := false
238 if !o.KeepEndTags {
239 if t.Hash == Thead || t.Hash == Tbody || t.Hash == Tfoot || t.Hash == Tr || t.Hash == Th ||
240 t.Hash == Td || t.Hash == Option || t.Hash == Dd || t.Hash == Dt || t.Hash == Li ||
241 t.Hash == Rb || t.Hash == Rt || t.Hash == Rtc || t.Hash == Rp {
242 omitEndTag = true // omit end tags
243 } else if t.Hash == P {
244 i := 0
245 for {
246 next := tb.Peek(i)
247 i++
248 // continue if text token is empty or whitespace
249 if next.TokenType == html.TextToken && parse.IsAllWhitespace(next.Data) {
250 continue
251 }
252 if next.TokenType == html.ErrorToken || next.TokenType == html.EndTagToken && next.Traits&keepPTag == 0 || next.TokenType == html.StartTagToken && next.Traits&omitPTag != 0 {
253 omitEndTag = true // omit p end tag
254 }
255 break
256 }
257 } else if t.Hash == Optgroup {
258 i := 0
259 for {
260 next := tb.Peek(i)
261 i++
262 // continue if text token
263 if next.TokenType == html.TextToken {
264 continue
265 }
266 if next.TokenType == html.ErrorToken || next.Hash != Option {
267 omitEndTag = true // omit optgroup end tag
268 }
269 break
270 }
271 }
272 }
273
274 if t.Traits&nonPhrasingTag != 0 {
275 omitSpace = true // omit spaces after block elements
276 } else if o.KeepWhitespace || t.Traits&objectTag != 0 {
277 omitSpace = false
278 }
279
280 if !omitEndTag {
281 if len(t.Data) > 3+len(t.Text) {
282 t.Data[2+len(t.Text)] = '>'
283 t.Data = t.Data[:3+len(t.Text)]
284 }
285 w.Write(t.Data)
286 }
287
288 // skip text in select and optgroup tags
289 if t.Hash == Option || t.Hash == Optgroup {
290 if next := tb.Peek(0); next.TokenType == html.TextToken {
291 tb.Shift()
292 }
293 }
294 break
295 }
296
297 if o.KeepWhitespace || t.Traits&objectTag != 0 {
298 omitSpace = false
299 } else if t.Traits&nonPhrasingTag != 0 {
300 omitSpace = true // omit spaces after block elements
301 }
302
303 w.Write(t.Data)
304
305 if hasAttributes {
306 if t.Hash == Meta {
307 attrs := tb.Attributes(Content, Http_Equiv, Charset, Name)
308 if content := attrs[0]; content != nil {
309 if httpEquiv := attrs[1]; httpEquiv != nil {
310 httpEquiv.AttrVal = parse.TrimWhitespace(httpEquiv.AttrVal)
311 if charset := attrs[2]; charset == nil && parse.EqualFold(httpEquiv.AttrVal, []byte("content-type")) {
312 content.AttrVal = minify.Mediatype(content.AttrVal)
313 if bytes.Equal(content.AttrVal, []byte("text/html;charset=utf-8")) {
314 httpEquiv.Text = nil
315 content.Text = []byte("charset")
316 content.Hash = Charset
317 content.AttrVal = []byte("utf-8")
318 }
319 }
320 }
321 if name := attrs[3]; name != nil {
322 name.AttrVal = parse.TrimWhitespace(name.AttrVal)
323 if parse.EqualFold(name.AttrVal, []byte("keywords")) {
324 content.AttrVal = bytes.ReplaceAll(content.AttrVal, []byte(", "), []byte(","))
325 } else if parse.EqualFold(name.AttrVal, []byte("viewport")) {
326 content.AttrVal = bytes.ReplaceAll(content.AttrVal, []byte(" "), []byte(""))
327 for i := 0; i < len(content.AttrVal); i++ {
328 if content.AttrVal[i] == '=' && i+2 < len(content.AttrVal) {
329 i++
330 if n := parse.Number(content.AttrVal[i:]); n > 0 {
331 minNum := minify.Number(content.AttrVal[i:i+n], -1)
332 if len(minNum) < n {
333 copy(content.AttrVal[i:i+len(minNum)], minNum)
334 copy(content.AttrVal[i+len(minNum):], content.AttrVal[i+n:])
335 content.AttrVal = content.AttrVal[:len(content.AttrVal)+len(minNum)-n]
336 }
337 i += len(minNum)
338 }
339 i-- // mitigate for-loop increase
340 }
341 }
342 }
343 }
344 }
345 } else if t.Hash == Script {
346 attrs := tb.Attributes(Src, Charset)
347 if attrs[0] != nil && attrs[1] != nil {
348 attrs[1].Text = nil
349 }
350 } else if t.Hash == Input {
351 attrs := tb.Attributes(Type, Value)
352 if t, value := attrs[0], attrs[1]; t != nil && value != nil {
353 isRadio := parse.EqualFold(t.AttrVal, radioBytes)
354 if !isRadio && len(value.AttrVal) == 0 {
355 value.Text = nil
356 } else if isRadio && parse.EqualFold(value.AttrVal, onBytes) {
357 value.Text = nil
358 }
359 }
360 } else if t.Hash == A {
361 attrs := tb.Attributes(Id, Name)
362 if id, name := attrs[0], attrs[1]; id != nil && name != nil {
363 if bytes.Equal(id.AttrVal, name.AttrVal) {
364 name.Text = nil
365 }
366 }
367 }
368
369 // write attributes
370 for {
371 attr := *tb.Shift()
372 if attr.TokenType != html.AttributeToken {
373 break
374 } else if attr.Text == nil {
375 continue // removed attribute
376 }
377
378 val := attr.AttrVal
379 if attr.Traits&trimAttr != 0 {
380 val = parse.ReplaceMultipleWhitespaceAndEntities(val, EntitiesMap, nil)
381 val = parse.TrimWhitespace(val)
382 } else {
383 val = parse.ReplaceEntities(val, EntitiesMap, nil)
384 }
385 if t.Traits != 0 {
386 if len(val) == 0 && (attr.Hash == Class ||
387 attr.Hash == Dir ||
388 attr.Hash == Id ||
389 attr.Hash == Name ||
390 attr.Hash == Action && t.Hash == Form) {
391 continue // omit empty attribute values
392 }
393 if attr.Traits&caselessAttr != 0 {
394 val = parse.ToLower(val)
395 }
396 if rawTagHash != 0 && attr.Hash == Type {
397 rawTagMediatype = parse.Copy(val)
398 }
399
400 if attr.Hash == Enctype || attr.Hash == Codetype || attr.Hash == Accept || attr.Hash == Type && (t.Hash == A || t.Hash == Link || t.Hash == Embed || t.Hash == Object || t.Hash == Source || t.Hash == Script || t.Hash == Style) {
401 val = minify.Mediatype(val)
402 }
403
404 // default attribute values can be omitted
405 if !o.KeepDefaultAttrVals && (attr.Hash == Type && (t.Hash == Script && jsMimetypes[string(val)] ||
406 t.Hash == Style && bytes.Equal(val, cssMimeBytes) ||
407 t.Hash == Link && bytes.Equal(val, cssMimeBytes) ||
408 t.Hash == Input && bytes.Equal(val, textBytes) ||
409 t.Hash == Button && bytes.Equal(val, submitBytes)) ||
410 attr.Hash == Language && t.Hash == Script ||
411 attr.Hash == Method && bytes.Equal(val, getBytes) ||
412 attr.Hash == Enctype && bytes.Equal(val, formMimeBytes) ||
413 attr.Hash == Colspan && bytes.Equal(val, oneBytes) ||
414 attr.Hash == Rowspan && bytes.Equal(val, oneBytes) ||
415 attr.Hash == Shape && bytes.Equal(val, rectBytes) ||
416 attr.Hash == Span && bytes.Equal(val, oneBytes) ||
417 attr.Hash == Clear && bytes.Equal(val, noneBytes) ||
418 attr.Hash == Frameborder && bytes.Equal(val, oneBytes) ||
419 attr.Hash == Scrolling && bytes.Equal(val, autoBytes) ||
420 attr.Hash == Valuetype && bytes.Equal(val, dataBytes) ||
421 attr.Hash == Media && t.Hash == Style && bytes.Equal(val, allBytes)) {
422 continue
423 }
424
425 if attr.Hash == Style {
426 // CSS minifier for attribute inline code
427 val = parse.TrimWhitespace(val)
428 attrMinifyBuffer.Reset()
429 if err := m.MinifyMimetype(cssMimeBytes, attrMinifyBuffer, buffer.NewReader(val), inlineParams); err == nil {
430 val = attrMinifyBuffer.Bytes()
431 } else if err != minify.ErrNotExist {
432 return minify.UpdateErrorPosition(err, z, attr.Offset)
433 }
434 if len(val) == 0 {
435 continue
436 }
437 } else if len(attr.Text) > 2 && attr.Text[0] == 'o' && attr.Text[1] == 'n' {
438 // JS minifier for attribute inline code
439 val = parse.TrimWhitespace(val)
440 if len(val) >= 11 && parse.EqualFold(val[:11], jsSchemeBytes) {
441 val = val[11:]
442 }
443 attrMinifyBuffer.Reset()
444 if err := m.MinifyMimetype(jsMimeBytes, attrMinifyBuffer, buffer.NewReader(val), nil); err == nil {
445 val = attrMinifyBuffer.Bytes()
446 } else if err != minify.ErrNotExist {
447 return minify.UpdateErrorPosition(err, z, attr.Offset)
448 }
449 if len(val) == 0 {
450 continue
451 }
452 } else if attr.Traits&urlAttr != 0 { // anchors are already handled
453 val = parse.TrimWhitespace(val)
454 if 5 < len(val) {
455 if parse.EqualFold(val[:4], httpBytes) {
456 if val[4] == ':' {
457 if m.URL != nil && m.URL.Scheme == "http" {
458 val = val[5:]
459 } else {
460 parse.ToLower(val[:4])
461 }
462 } else if (val[4] == 's' || val[4] == 'S') && val[5] == ':' {
463 if m.URL != nil && m.URL.Scheme == "https" {
464 val = val[6:]
465 } else {
466 parse.ToLower(val[:5])
467 }
468 }
469 } else if parse.EqualFold(val[:5], dataSchemeBytes) {
470 val = minify.DataURI(m, val)
471 }
472 }
473 }
474 }
475
476 w.Write(spaceBytes)
477 w.Write(attr.Text)
478 if len(val) > 0 && attr.Traits&booleanAttr == 0 {
479 w.Write(isBytes)
480
481 // use double quotes for RDFa attributes
482 isXML := attr.Hash == Vocab || attr.Hash == Typeof || attr.Hash == Property || attr.Hash == Resource || attr.Hash == Prefix || attr.Hash == Content || attr.Hash == About || attr.Hash == Rev || attr.Hash == Datatype || attr.Hash == Inlist
483
484 // no quotes if possible, else prefer single or double depending on which occurs more often in value
485 var quote byte
486
487 if 0 < len(attr.Data) && (attr.Data[len(attr.Data)-1] == '\'' || attr.Data[len(attr.Data)-1] == '"') {
488 quote = attr.Data[len(attr.Data)-1]
489 }
490 val = html.EscapeAttrVal(&attrByteBuffer, val, quote, o.KeepQuotes, isXML)
491 w.Write(val)
492 }
493 }
494 } else {
495 _ = tb.Shift() // StartTagClose
496 }
497 w.Write(gtBytes)
498
499 // skip text in select and optgroup tags
500 if t.Hash == Select || t.Hash == Optgroup {
501 if next := tb.Peek(0); next.TokenType == html.TextToken {
502 tb.Shift()
503 }
504 }
505
506 // keep space after phrasing tags (<i>, <span>, ...) FontAwesome etc.
507 if t.TokenType == html.StartTagToken && t.Traits&nonPhrasingTag == 0 {
508 if next := tb.Peek(0); next.Hash == t.Hash && next.TokenType == html.EndTagToken {
509 omitSpace = false
510 }
511 }
512 }
513 }
514}
diff --git a/vendor/github.com/tdewolff/minify/v2/html/table.go b/vendor/github.com/tdewolff/minify/v2/html/table.go
new file mode 100644
index 0000000..22239fc
--- /dev/null
+++ b/vendor/github.com/tdewolff/minify/v2/html/table.go
@@ -0,0 +1,1346 @@
1package html
2
3type traits uint16
4
5const (
6 normalTag traits = 1 << iota
7 rawTag // raw tags need special processing for their content
8 nonPhrasingTag // non-phrasing elements are unaffected by whitespace, remove spaces around these tags
9 objectTag // content tags with a few exclusions, keep spaces after these open/close tags
10 omitPTag // omit p end tag if it is followed by this start tag
11 keepPTag // keep p end tag if it is followed by this end tag
12)
13
14const (
15 booleanAttr traits = 1 << iota
16 caselessAttr
17 urlAttr
18 trimAttr
19)
20
21var tagMap = map[Hash]traits{
22 A: keepPTag,
23 Abbr: normalTag,
24 Address: nonPhrasingTag | omitPTag,
25 Area: normalTag,
26 Article: nonPhrasingTag | omitPTag,
27 Aside: nonPhrasingTag | omitPTag,
28 Audio: keepPTag,
29 B: normalTag,
30 Base: normalTag,
31 Bb: normalTag,
32 Bdi: normalTag,
33 Bdo: normalTag,
34 Blockquote: nonPhrasingTag | omitPTag,
35 Body: nonPhrasingTag,
36 Br: nonPhrasingTag,
37 Button: objectTag,
38 Canvas: objectTag | keepPTag,
39 Caption: nonPhrasingTag,
40 Cite: normalTag,
41 Code: normalTag,
42 Col: nonPhrasingTag,
43 Colgroup: nonPhrasingTag,
44 Data: normalTag,
45 Datalist: normalTag,
46 Dd: nonPhrasingTag,
47 Del: keepPTag,
48 Details: omitPTag,
49 Dfn: normalTag,
50 Dialog: normalTag,
51 Div: nonPhrasingTag | omitPTag,
52 Dl: nonPhrasingTag | omitPTag,
53 Dt: nonPhrasingTag,
54 Em: normalTag,
55 Embed: nonPhrasingTag,
56 Fieldset: nonPhrasingTag | omitPTag,
57 Figcaption: nonPhrasingTag | omitPTag,
58 Figure: nonPhrasingTag | omitPTag,
59 Footer: nonPhrasingTag | omitPTag,
60 Form: nonPhrasingTag | omitPTag,
61 H1: nonPhrasingTag | omitPTag,
62 H2: nonPhrasingTag | omitPTag,
63 H3: nonPhrasingTag | omitPTag,
64 H4: nonPhrasingTag | omitPTag,
65 H5: nonPhrasingTag | omitPTag,
66 H6: nonPhrasingTag | omitPTag,
67 Head: nonPhrasingTag,
68 Header: nonPhrasingTag | omitPTag,
69 Hgroup: nonPhrasingTag,
70 Hr: nonPhrasingTag | omitPTag,
71 Html: nonPhrasingTag,
72 I: normalTag,
73 Iframe: rawTag | objectTag,
74 Img: objectTag,
75 Input: objectTag,
76 Ins: keepPTag,
77 Kbd: normalTag,
78 Label: normalTag,
79 Legend: normalTag,
80 Li: nonPhrasingTag,
81 Link: normalTag,
82 Main: nonPhrasingTag | omitPTag,
83 Map: keepPTag,
84 Mark: normalTag,
85 Math: rawTag,
86 Menu: omitPTag,
87 Meta: nonPhrasingTag,
88 Meter: objectTag,
89 Nav: nonPhrasingTag | omitPTag,
90 Noscript: nonPhrasingTag | keepPTag,
91 Object: objectTag,
92 Ol: nonPhrasingTag | omitPTag,
93 Optgroup: normalTag,
94 Option: normalTag,
95 Output: nonPhrasingTag,
96 P: nonPhrasingTag | omitPTag,
97 Param: normalTag,
98 Picture: normalTag,
99 Pre: nonPhrasingTag | omitPTag,
100 Progress: objectTag,
101 Q: objectTag,
102 Rp: normalTag,
103 Rt: normalTag,
104 Ruby: normalTag,
105 S: normalTag,
106 Samp: normalTag,
107 Script: rawTag,
108 Section: nonPhrasingTag | omitPTag,
109 Select: objectTag,
110 Slot: normalTag,
111 Small: normalTag,
112 Source: normalTag,
113 Span: normalTag,
114 Strong: normalTag,
115 Style: rawTag | nonPhrasingTag,
116 Sub: normalTag,
117 Summary: normalTag,
118 Sup: normalTag,
119 Svg: rawTag | objectTag,
120 Table: nonPhrasingTag | omitPTag,
121 Tbody: nonPhrasingTag,
122 Td: nonPhrasingTag,
123 Template: normalTag,
124 Textarea: rawTag | objectTag,
125 Tfoot: nonPhrasingTag,
126 Th: nonPhrasingTag,
127 Thead: nonPhrasingTag,
128 Time: normalTag,
129 Title: nonPhrasingTag,
130 Tr: nonPhrasingTag,
131 Track: normalTag,
132 U: normalTag,
133 Ul: nonPhrasingTag | omitPTag,
134 Var: normalTag,
135 Video: objectTag | keepPTag,
136 Wbr: normalTag,
137}
138
139var attrMap = map[Hash]traits{
140 Accept: trimAttr,
141 Accept_Charset: caselessAttr,
142 Action: urlAttr,
143 Align: caselessAttr,
144 Alink: caselessAttr,
145 Allowfullscreen: booleanAttr,
146 Async: booleanAttr,
147 Autofocus: booleanAttr,
148 Autoplay: booleanAttr,
149 Axis: caselessAttr,
150 Background: urlAttr,
151 Bgcolor: caselessAttr,
152 Charset: caselessAttr,
153 Checked: booleanAttr,
154 Cite: urlAttr,
155 Class: trimAttr,
156 Classid: urlAttr,
157 Clear: caselessAttr,
158 Codebase: urlAttr,
159 Codetype: trimAttr,
160 Color: caselessAttr,
161 Cols: trimAttr,
162 Colspan: trimAttr,
163 Compact: booleanAttr,
164 Controls: booleanAttr,
165 Data: urlAttr,
166 Declare: booleanAttr,
167 Default: booleanAttr,
168 DefaultChecked: booleanAttr,
169 DefaultMuted: booleanAttr,
170 DefaultSelected: booleanAttr,
171 Defer: booleanAttr,
172 Dir: caselessAttr,
173 Disabled: booleanAttr,
174 Enabled: booleanAttr,
175 Enctype: trimAttr,
176 Face: caselessAttr,
177 Formaction: urlAttr,
178 Formnovalidate: booleanAttr,
179 Frame: caselessAttr,
180 Hidden: booleanAttr,
181 Href: urlAttr,
182 Hreflang: caselessAttr,
183 Http_Equiv: caselessAttr,
184 Icon: urlAttr,
185 Inert: booleanAttr,
186 Ismap: booleanAttr,
187 Itemscope: booleanAttr,
188 Lang: trimAttr,
189 Language: caselessAttr,
190 Link: caselessAttr,
191 Longdesc: urlAttr,
192 Manifest: urlAttr,
193 Maxlength: trimAttr,
194 Media: caselessAttr | trimAttr,
195 Method: caselessAttr,
196 Multiple: booleanAttr,
197 Muted: booleanAttr,
198 Nohref: booleanAttr,
199 Noresize: booleanAttr,
200 Noshade: booleanAttr,
201 Novalidate: booleanAttr,
202 Nowrap: booleanAttr,
203 Open: booleanAttr,
204 Pauseonexit: booleanAttr,
205 Poster: urlAttr,
206 Profile: urlAttr,
207 Readonly: booleanAttr,
208 Rel: caselessAttr | trimAttr,
209 Required: booleanAttr,
210 Rev: caselessAttr,
211 Reversed: booleanAttr,
212 Rows: trimAttr,
213 Rowspan: trimAttr,
214 Rules: caselessAttr,
215 Scope: caselessAttr,
216 Scoped: booleanAttr,
217 Scrolling: caselessAttr,
218 Seamless: booleanAttr,
219 Selected: booleanAttr,
220 Shape: caselessAttr,
221 Size: trimAttr,
222 Sortable: booleanAttr,
223 Span: trimAttr,
224 Src: urlAttr,
225 Srcset: trimAttr,
226 Tabindex: trimAttr,
227 Target: caselessAttr,
228 Text: caselessAttr,
229 Translate: caselessAttr,
230 Truespeed: booleanAttr,
231 Type: trimAttr,
232 Typemustmatch: booleanAttr,
233 Undeterminate: booleanAttr,
234 Usemap: urlAttr,
235 Valign: caselessAttr,
236 Valuetype: caselessAttr,
237 Vlink: caselessAttr,
238 Visible: booleanAttr,
239 Xmlns: urlAttr,
240}
241
242var jsMimetypes = map[string]bool{
243 "text/javascript": true,
244 "application/javascript": true,
245}
246
247// EntitiesMap are all named character entities.
248var EntitiesMap = map[string][]byte{
249 "AElig": []byte("&#198;"),
250 "AMP": []byte("&"),
251 "Aacute": []byte("&#193;"),
252 "Abreve": []byte("&#258;"),
253 "Acirc": []byte("&#194;"),
254 "Agrave": []byte("&#192;"),
255 "Alpha": []byte("&#913;"),
256 "Amacr": []byte("&#256;"),
257 "Aogon": []byte("&#260;"),
258 "ApplyFunction": []byte("&af;"),
259 "Aring": []byte("&#197;"),
260 "Assign": []byte("&#8788;"),
261 "Atilde": []byte("&#195;"),
262 "Backslash": []byte("&#8726;"),
263 "Barwed": []byte("&#8966;"),
264 "Because": []byte("&#8757;"),
265 "Bernoullis": []byte("&Bscr;"),
266 "Breve": []byte("&#728;"),
267 "Bumpeq": []byte("&bump;"),
268 "Cacute": []byte("&#262;"),
269 "CapitalDifferentialD": []byte("&DD;"),
270 "Cayleys": []byte("&Cfr;"),
271 "Ccaron": []byte("&#268;"),
272 "Ccedil": []byte("&#199;"),
273 "Ccirc": []byte("&#264;"),
274 "Cconint": []byte("&#8752;"),
275 "Cedilla": []byte("&#184;"),
276 "CenterDot": []byte("&#183;"),
277 "CircleDot": []byte("&odot;"),
278 "CircleMinus": []byte("&#8854;"),
279 "CirclePlus": []byte("&#8853;"),
280 "CircleTimes": []byte("&#8855;"),
281 "ClockwiseContourIntegral": []byte("&#8754;"),
282 "CloseCurlyDoubleQuote": []byte("&#8221;"),
283 "CloseCurlyQuote": []byte("&#8217;"),
284 "Congruent": []byte("&#8801;"),
285 "Conint": []byte("&#8751;"),
286 "ContourIntegral": []byte("&oint;"),
287 "Coproduct": []byte("&#8720;"),
288 "CounterClockwiseContourIntegral": []byte("&#8755;"),
289 "CupCap": []byte("&#8781;"),
290 "DDotrahd": []byte("&#10513;"),
291 "Dagger": []byte("&#8225;"),
292 "Dcaron": []byte("&#270;"),
293 "Delta": []byte("&#916;"),
294 "DiacriticalAcute": []byte("&#180;"),
295 "DiacriticalDot": []byte("&dot;"),
296 "DiacriticalDoubleAcute": []byte("&#733;"),
297 "DiacriticalGrave": []byte("`"),
298 "DiacriticalTilde": []byte("&#732;"),
299 "Diamond": []byte("&diam;"),
300 "DifferentialD": []byte("&dd;"),
301 "DotDot": []byte("&#8412;"),
302 "DotEqual": []byte("&#8784;"),
303 "DoubleContourIntegral": []byte("&#8751;"),
304 "DoubleDot": []byte("&Dot;"),
305 "DoubleDownArrow": []byte("&dArr;"),
306 "DoubleLeftArrow": []byte("&lArr;"),
307 "DoubleLeftRightArrow": []byte("&iff;"),
308 "DoubleLeftTee": []byte("&Dashv;"),
309 "DoubleLongLeftArrow": []byte("&xlArr;"),
310 "DoubleLongLeftRightArrow": []byte("&xhArr;"),
311 "DoubleLongRightArrow": []byte("&xrArr;"),
312 "DoubleRightArrow": []byte("&rArr;"),
313 "DoubleRightTee": []byte("&#8872;"),
314 "DoubleUpArrow": []byte("&uArr;"),
315 "DoubleUpDownArrow": []byte("&vArr;"),
316 "DoubleVerticalBar": []byte("&par;"),
317 "DownArrow": []byte("&darr;"),
318 "DownArrowBar": []byte("&#10515;"),
319 "DownArrowUpArrow": []byte("&#8693;"),
320 "DownBreve": []byte("&#785;"),
321 "DownLeftRightVector": []byte("&#10576;"),
322 "DownLeftTeeVector": []byte("&#10590;"),
323 "DownLeftVector": []byte("&#8637;"),
324 "DownLeftVectorBar": []byte("&#10582;"),
325 "DownRightTeeVector": []byte("&#10591;"),
326 "DownRightVector": []byte("&#8641;"),
327 "DownRightVectorBar": []byte("&#10583;"),
328 "DownTee": []byte("&top;"),
329 "DownTeeArrow": []byte("&#8615;"),
330 "Downarrow": []byte("&dArr;"),
331 "Dstrok": []byte("&#272;"),
332 "Eacute": []byte("&#201;"),
333 "Ecaron": []byte("&#282;"),
334 "Ecirc": []byte("&#202;"),
335 "Egrave": []byte("&#200;"),
336 "Element": []byte("&in;"),
337 "Emacr": []byte("&#274;"),
338 "EmptySmallSquare": []byte("&#9723;"),
339 "EmptyVerySmallSquare": []byte("&#9643;"),
340 "Eogon": []byte("&#280;"),
341 "Epsilon": []byte("&#917;"),
342 "EqualTilde": []byte("&esim;"),
343 "Equilibrium": []byte("&#8652;"),
344 "Exists": []byte("&#8707;"),
345 "ExponentialE": []byte("&ee;"),
346 "FilledSmallSquare": []byte("&#9724;"),
347 "FilledVerySmallSquare": []byte("&squf;"),
348 "ForAll": []byte("&#8704;"),
349 "Fouriertrf": []byte("&Fscr;"),
350 "GT": []byte(">"),
351 "Gamma": []byte("&#915;"),
352 "Gammad": []byte("&#988;"),
353 "Gbreve": []byte("&#286;"),
354 "Gcedil": []byte("&#290;"),
355 "Gcirc": []byte("&#284;"),
356 "GreaterEqual": []byte("&ge;"),
357 "GreaterEqualLess": []byte("&gel;"),
358 "GreaterFullEqual": []byte("&gE;"),
359 "GreaterGreater": []byte("&#10914;"),
360 "GreaterLess": []byte("&gl;"),
361 "GreaterSlantEqual": []byte("&ges;"),
362 "GreaterTilde": []byte("&gsim;"),
363 "HARDcy": []byte("&#1066;"),
364 "Hacek": []byte("&#711;"),
365 "Hat": []byte("^"),
366 "Hcirc": []byte("&#292;"),
367 "HilbertSpace": []byte("&Hscr;"),
368 "HorizontalLine": []byte("&boxh;"),
369 "Hstrok": []byte("&#294;"),
370 "HumpDownHump": []byte("&bump;"),
371 "HumpEqual": []byte("&#8783;"),
372 "IJlig": []byte("&#306;"),
373 "Iacute": []byte("&#205;"),
374 "Icirc": []byte("&#206;"),
375 "Ifr": []byte("&Im;"),
376 "Igrave": []byte("&#204;"),
377 "Imacr": []byte("&#298;"),
378 "ImaginaryI": []byte("&ii;"),
379 "Implies": []byte("&rArr;"),
380 "Integral": []byte("&int;"),
381 "Intersection": []byte("&xcap;"),
382 "InvisibleComma": []byte("&ic;"),
383 "InvisibleTimes": []byte("&it;"),
384 "Iogon": []byte("&#302;"),
385 "Itilde": []byte("&#296;"),
386 "Jcirc": []byte("&#308;"),
387 "Jsercy": []byte("&#1032;"),
388 "Kappa": []byte("&#922;"),
389 "Kcedil": []byte("&#310;"),
390 "LT": []byte("<"),
391 "Lacute": []byte("&#313;"),
392 "Lambda": []byte("&#923;"),
393 "Laplacetrf": []byte("&Lscr;"),
394 "Lcaron": []byte("&#317;"),
395 "Lcedil": []byte("&#315;"),
396 "LeftAngleBracket": []byte("&lang;"),
397 "LeftArrow": []byte("&larr;"),
398 "LeftArrowBar": []byte("&#8676;"),
399 "LeftArrowRightArrow": []byte("&#8646;"),
400 "LeftCeiling": []byte("&#8968;"),
401 "LeftDoubleBracket": []byte("&lobrk;"),
402 "LeftDownTeeVector": []byte("&#10593;"),
403 "LeftDownVector": []byte("&#8643;"),
404 "LeftDownVectorBar": []byte("&#10585;"),
405 "LeftFloor": []byte("&#8970;"),
406 "LeftRightArrow": []byte("&harr;"),
407 "LeftRightVector": []byte("&#10574;"),
408 "LeftTee": []byte("&#8867;"),
409 "LeftTeeArrow": []byte("&#8612;"),
410 "LeftTeeVector": []byte("&#10586;"),
411 "LeftTriangle": []byte("&#8882;"),
412 "LeftTriangleBar": []byte("&#10703;"),
413 "LeftTriangleEqual": []byte("&#8884;"),
414 "LeftUpDownVector": []byte("&#10577;"),
415 "LeftUpTeeVector": []byte("&#10592;"),
416 "LeftUpVector": []byte("&#8639;"),
417 "LeftUpVectorBar": []byte("&#10584;"),
418 "LeftVector": []byte("&#8636;"),
419 "LeftVectorBar": []byte("&#10578;"),
420 "Leftarrow": []byte("&lArr;"),
421 "Leftrightarrow": []byte("&iff;"),
422 "LessEqualGreater": []byte("&leg;"),
423 "LessFullEqual": []byte("&lE;"),
424 "LessGreater": []byte("&lg;"),
425 "LessLess": []byte("&#10913;"),
426 "LessSlantEqual": []byte("&les;"),
427 "LessTilde": []byte("&lsim;"),
428 "Lleftarrow": []byte("&#8666;"),
429 "Lmidot": []byte("&#319;"),
430 "LongLeftArrow": []byte("&xlarr;"),
431 "LongLeftRightArrow": []byte("&xharr;"),
432 "LongRightArrow": []byte("&xrarr;"),
433 "Longleftarrow": []byte("&xlArr;"),
434 "Longleftrightarrow": []byte("&xhArr;"),
435 "Longrightarrow": []byte("&xrArr;"),
436 "LowerLeftArrow": []byte("&#8601;"),
437 "LowerRightArrow": []byte("&#8600;"),
438 "Lstrok": []byte("&#321;"),
439 "MediumSpace": []byte("&#8287;"),
440 "Mellintrf": []byte("&Mscr;"),
441 "MinusPlus": []byte("&mp;"),
442 "Nacute": []byte("&#323;"),
443 "Ncaron": []byte("&#327;"),
444 "Ncedil": []byte("&#325;"),
445 "NegativeMediumSpace": []byte("&#8203;"),
446 "NegativeThickSpace": []byte("&#8203;"),
447 "NegativeThinSpace": []byte("&#8203;"),
448 "NegativeVeryThinSpace": []byte("&#8203;"),
449 "NestedGreaterGreater": []byte("&Gt;"),
450 "NestedLessLess": []byte("&Lt;"),
451 "NewLine": []byte("\n"),
452 "NoBreak": []byte("&#8288;"),
453 "NonBreakingSpace": []byte("&#160;"),
454 "NotCongruent": []byte("&#8802;"),
455 "NotCupCap": []byte("&#8813;"),
456 "NotDoubleVerticalBar": []byte("&npar;"),
457 "NotElement": []byte("&#8713;"),
458 "NotEqual": []byte("&ne;"),
459 "NotExists": []byte("&#8708;"),
460 "NotGreater": []byte("&ngt;"),
461 "NotGreaterEqual": []byte("&nge;"),
462 "NotGreaterLess": []byte("&ntgl;"),
463 "NotGreaterTilde": []byte("&#8821;"),
464 "NotLeftTriangle": []byte("&#8938;"),
465 "NotLeftTriangleEqual": []byte("&#8940;"),
466 "NotLess": []byte("&nlt;"),
467 "NotLessEqual": []byte("&nle;"),
468 "NotLessGreater": []byte("&ntlg;"),
469 "NotLessTilde": []byte("&#8820;"),
470 "NotPrecedes": []byte("&npr;"),
471 "NotPrecedesSlantEqual": []byte("&#8928;"),
472 "NotReverseElement": []byte("&#8716;"),
473 "NotRightTriangle": []byte("&#8939;"),
474 "NotRightTriangleEqual": []byte("&#8941;"),
475 "NotSquareSubsetEqual": []byte("&#8930;"),
476 "NotSquareSupersetEqual": []byte("&#8931;"),
477 "NotSubsetEqual": []byte("&#8840;"),
478 "NotSucceeds": []byte("&nsc;"),
479 "NotSucceedsSlantEqual": []byte("&#8929;"),
480 "NotSupersetEqual": []byte("&#8841;"),
481 "NotTilde": []byte("&nsim;"),
482 "NotTildeEqual": []byte("&#8772;"),
483 "NotTildeFullEqual": []byte("&#8775;"),
484 "NotTildeTilde": []byte("&nap;"),
485 "NotVerticalBar": []byte("&nmid;"),
486 "Ntilde": []byte("&#209;"),
487 "OElig": []byte("&#338;"),
488 "Oacute": []byte("&#211;"),
489 "Ocirc": []byte("&#212;"),
490 "Odblac": []byte("&#336;"),
491 "Ograve": []byte("&#210;"),
492 "Omacr": []byte("&#332;"),
493 "Omega": []byte("&ohm;"),
494 "Omicron": []byte("&#927;"),
495 "OpenCurlyDoubleQuote": []byte("&#8220;"),
496 "OpenCurlyQuote": []byte("&#8216;"),
497 "Oslash": []byte("&#216;"),
498 "Otilde": []byte("&#213;"),
499 "OverBar": []byte("&#8254;"),
500 "OverBrace": []byte("&#9182;"),
501 "OverBracket": []byte("&tbrk;"),
502 "OverParenthesis": []byte("&#9180;"),
503 "PartialD": []byte("&part;"),
504 "PlusMinus": []byte("&pm;"),
505 "Poincareplane": []byte("&Hfr;"),
506 "Precedes": []byte("&pr;"),
507 "PrecedesEqual": []byte("&pre;"),
508 "PrecedesSlantEqual": []byte("&#8828;"),
509 "PrecedesTilde": []byte("&#8830;"),
510 "Product": []byte("&prod;"),
511 "Proportion": []byte("&#8759;"),
512 "Proportional": []byte("&prop;"),
513 "QUOT": []byte("\""),
514 "Racute": []byte("&#340;"),
515 "Rcaron": []byte("&#344;"),
516 "Rcedil": []byte("&#342;"),
517 "ReverseElement": []byte("&ni;"),
518 "ReverseEquilibrium": []byte("&#8651;"),
519 "ReverseUpEquilibrium": []byte("&duhar;"),
520 "Rfr": []byte("&Re;"),
521 "RightAngleBracket": []byte("&rang;"),
522 "RightArrow": []byte("&rarr;"),
523 "RightArrowBar": []byte("&#8677;"),
524 "RightArrowLeftArrow": []byte("&#8644;"),
525 "RightCeiling": []byte("&#8969;"),
526 "RightDoubleBracket": []byte("&robrk;"),
527 "RightDownTeeVector": []byte("&#10589;"),
528 "RightDownVector": []byte("&#8642;"),
529 "RightDownVectorBar": []byte("&#10581;"),
530 "RightFloor": []byte("&#8971;"),
531 "RightTee": []byte("&#8866;"),
532 "RightTeeArrow": []byte("&map;"),
533 "RightTeeVector": []byte("&#10587;"),
534 "RightTriangle": []byte("&#8883;"),
535 "RightTriangleBar": []byte("&#10704;"),
536 "RightTriangleEqual": []byte("&#8885;"),
537 "RightUpDownVector": []byte("&#10575;"),
538 "RightUpTeeVector": []byte("&#10588;"),
539 "RightUpVector": []byte("&#8638;"),
540 "RightUpVectorBar": []byte("&#10580;"),
541 "RightVector": []byte("&#8640;"),
542 "RightVectorBar": []byte("&#10579;"),
543 "Rightarrow": []byte("&rArr;"),
544 "RoundImplies": []byte("&#10608;"),
545 "Rrightarrow": []byte("&#8667;"),
546 "RuleDelayed": []byte("&#10740;"),
547 "SHCHcy": []byte("&#1065;"),
548 "SOFTcy": []byte("&#1068;"),
549 "Sacute": []byte("&#346;"),
550 "Scaron": []byte("&#352;"),
551 "Scedil": []byte("&#350;"),
552 "Scirc": []byte("&#348;"),
553 "ShortDownArrow": []byte("&darr;"),
554 "ShortLeftArrow": []byte("&larr;"),
555 "ShortRightArrow": []byte("&rarr;"),
556 "ShortUpArrow": []byte("&uarr;"),
557 "Sigma": []byte("&#931;"),
558 "SmallCircle": []byte("&#8728;"),
559 "Square": []byte("&squ;"),
560 "SquareIntersection": []byte("&#8851;"),
561 "SquareSubset": []byte("&#8847;"),
562 "SquareSubsetEqual": []byte("&#8849;"),
563 "SquareSuperset": []byte("&#8848;"),
564 "SquareSupersetEqual": []byte("&#8850;"),
565 "SquareUnion": []byte("&#8852;"),
566 "Subset": []byte("&Sub;"),
567 "SubsetEqual": []byte("&sube;"),
568 "Succeeds": []byte("&sc;"),
569 "SucceedsEqual": []byte("&sce;"),
570 "SucceedsSlantEqual": []byte("&#8829;"),
571 "SucceedsTilde": []byte("&#8831;"),
572 "SuchThat": []byte("&ni;"),
573 "Superset": []byte("&sup;"),
574 "SupersetEqual": []byte("&supe;"),
575 "Supset": []byte("&Sup;"),
576 "THORN": []byte("&#222;"),
577 "Tab": []byte(" "),
578 "Tcaron": []byte("&#356;"),
579 "Tcedil": []byte("&#354;"),
580 "Therefore": []byte("&#8756;"),
581 "Theta": []byte("&#920;"),
582 "ThinSpace": []byte("&#8201;"),
583 "Tilde": []byte("&sim;"),
584 "TildeEqual": []byte("&sime;"),
585 "TildeFullEqual": []byte("&cong;"),
586 "TildeTilde": []byte("&ap;"),
587 "TripleDot": []byte("&tdot;"),
588 "Tstrok": []byte("&#358;"),
589 "Uacute": []byte("&#218;"),
590 "Uarrocir": []byte("&#10569;"),
591 "Ubreve": []byte("&#364;"),
592 "Ucirc": []byte("&#219;"),
593 "Udblac": []byte("&#368;"),
594 "Ugrave": []byte("&#217;"),
595 "Umacr": []byte("&#362;"),
596 "UnderBar": []byte("_"),
597 "UnderBrace": []byte("&#9183;"),
598 "UnderBracket": []byte("&bbrk;"),
599 "UnderParenthesis": []byte("&#9181;"),
600 "Union": []byte("&xcup;"),
601 "UnionPlus": []byte("&#8846;"),
602 "Uogon": []byte("&#370;"),
603 "UpArrow": []byte("&uarr;"),
604 "UpArrowBar": []byte("&#10514;"),
605 "UpArrowDownArrow": []byte("&#8645;"),
606 "UpDownArrow": []byte("&varr;"),
607 "UpEquilibrium": []byte("&udhar;"),
608 "UpTee": []byte("&bot;"),
609 "UpTeeArrow": []byte("&#8613;"),
610 "Uparrow": []byte("&uArr;"),
611 "Updownarrow": []byte("&vArr;"),
612 "UpperLeftArrow": []byte("&#8598;"),
613 "UpperRightArrow": []byte("&#8599;"),
614 "Upsilon": []byte("&#933;"),
615 "Uring": []byte("&#366;"),
616 "Utilde": []byte("&#360;"),
617 "Verbar": []byte("&Vert;"),
618 "VerticalBar": []byte("&mid;"),
619 "VerticalLine": []byte("|"),
620 "VerticalSeparator": []byte("&#10072;"),
621 "VerticalTilde": []byte("&wr;"),
622 "VeryThinSpace": []byte("&#8202;"),
623 "Vvdash": []byte("&#8874;"),
624 "Wcirc": []byte("&#372;"),
625 "Yacute": []byte("&#221;"),
626 "Ycirc": []byte("&#374;"),
627 "Zacute": []byte("&#377;"),
628 "Zcaron": []byte("&#381;"),
629 "ZeroWidthSpace": []byte("&#8203;"),
630 "aacute": []byte("&#225;"),
631 "abreve": []byte("&#259;"),
632 "acirc": []byte("&#226;"),
633 "acute": []byte("&#180;"),
634 "aelig": []byte("&#230;"),
635 "agrave": []byte("&#224;"),
636 "alefsym": []byte("&#8501;"),
637 "alpha": []byte("&#945;"),
638 "amacr": []byte("&#257;"),
639 "amp": []byte("&"),
640 "andslope": []byte("&#10840;"),
641 "angle": []byte("&ang;"),
642 "angmsd": []byte("&#8737;"),
643 "angmsdaa": []byte("&#10664;"),
644 "angmsdab": []byte("&#10665;"),
645 "angmsdac": []byte("&#10666;"),
646 "angmsdad": []byte("&#10667;"),
647 "angmsdae": []byte("&#10668;"),
648 "angmsdaf": []byte("&#10669;"),
649 "angmsdag": []byte("&#10670;"),
650 "angmsdah": []byte("&#10671;"),
651 "angrtvb": []byte("&#8894;"),
652 "angrtvbd": []byte("&#10653;"),
653 "angsph": []byte("&#8738;"),
654 "angst": []byte("&#197;"),
655 "angzarr": []byte("&#9084;"),
656 "aogon": []byte("&#261;"),
657 "apos": []byte("'"),
658 "approx": []byte("&ap;"),
659 "approxeq": []byte("&ape;"),
660 "aring": []byte("&#229;"),
661 "ast": []byte("*"),
662 "asymp": []byte("&ap;"),
663 "asympeq": []byte("&#8781;"),
664 "atilde": []byte("&#227;"),
665 "awconint": []byte("&#8755;"),
666 "backcong": []byte("&#8780;"),
667 "backepsilon": []byte("&#1014;"),
668 "backprime": []byte("&#8245;"),
669 "backsim": []byte("&bsim;"),
670 "backsimeq": []byte("&#8909;"),
671 "barvee": []byte("&#8893;"),
672 "barwed": []byte("&#8965;"),
673 "barwedge": []byte("&#8965;"),
674 "bbrktbrk": []byte("&#9142;"),
675 "becaus": []byte("&#8757;"),
676 "because": []byte("&#8757;"),
677 "bemptyv": []byte("&#10672;"),
678 "bernou": []byte("&Bscr;"),
679 "between": []byte("&#8812;"),
680 "bigcap": []byte("&xcap;"),
681 "bigcirc": []byte("&#9711;"),
682 "bigcup": []byte("&xcup;"),
683 "bigodot": []byte("&xodot;"),
684 "bigoplus": []byte("&#10753;"),
685 "bigotimes": []byte("&#10754;"),
686 "bigsqcup": []byte("&#10758;"),
687 "bigstar": []byte("&#9733;"),
688 "bigtriangledown": []byte("&#9661;"),
689 "bigtriangleup": []byte("&#9651;"),
690 "biguplus": []byte("&#10756;"),
691 "bigvee": []byte("&Vee;"),
692 "bigwedge": []byte("&#8896;"),
693 "bkarow": []byte("&rbarr;"),
694 "blacklozenge": []byte("&lozf;"),
695 "blacksquare": []byte("&squf;"),
696 "blacktriangle": []byte("&#9652;"),
697 "blacktriangledown": []byte("&#9662;"),
698 "blacktriangleleft": []byte("&#9666;"),
699 "blacktriangleright": []byte("&#9656;"),
700 "bottom": []byte("&bot;"),
701 "bowtie": []byte("&#8904;"),
702 "boxminus": []byte("&#8863;"),
703 "boxplus": []byte("&#8862;"),
704 "boxtimes": []byte("&#8864;"),
705 "bprime": []byte("&#8245;"),
706 "breve": []byte("&#728;"),
707 "brvbar": []byte("&#166;"),
708 "bsol": []byte("\\"),
709 "bsolhsub": []byte("&#10184;"),
710 "bullet": []byte("&bull;"),
711 "bumpeq": []byte("&#8783;"),
712 "cacute": []byte("&#263;"),
713 "capbrcup": []byte("&#10825;"),
714 "caron": []byte("&#711;"),
715 "ccaron": []byte("&#269;"),
716 "ccedil": []byte("&#231;"),
717 "ccirc": []byte("&#265;"),
718 "ccupssm": []byte("&#10832;"),
719 "cedil": []byte("&#184;"),
720 "cemptyv": []byte("&#10674;"),
721 "centerdot": []byte("&#183;"),
722 "checkmark": []byte("&check;"),
723 "circeq": []byte("&cire;"),
724 "circlearrowleft": []byte("&#8634;"),
725 "circlearrowright": []byte("&#8635;"),
726 "circledR": []byte("&REG;"),
727 "circledS": []byte("&oS;"),
728 "circledast": []byte("&oast;"),
729 "circledcirc": []byte("&ocir;"),
730 "circleddash": []byte("&#8861;"),
731 "cirfnint": []byte("&#10768;"),
732 "cirscir": []byte("&#10690;"),
733 "clubsuit": []byte("&#9827;"),
734 "colon": []byte(":"),
735 "colone": []byte("&#8788;"),
736 "coloneq": []byte("&#8788;"),
737 "comma": []byte(","),
738 "commat": []byte("@"),
739 "compfn": []byte("&#8728;"),
740 "complement": []byte("&comp;"),
741 "complexes": []byte("&Copf;"),
742 "congdot": []byte("&#10861;"),
743 "conint": []byte("&oint;"),
744 "coprod": []byte("&#8720;"),
745 "copysr": []byte("&#8471;"),
746 "cudarrl": []byte("&#10552;"),
747 "cudarrr": []byte("&#10549;"),
748 "cularr": []byte("&#8630;"),
749 "cularrp": []byte("&#10557;"),
750 "cupbrcap": []byte("&#10824;"),
751 "cupdot": []byte("&#8845;"),
752 "curarr": []byte("&#8631;"),
753 "curarrm": []byte("&#10556;"),
754 "curlyeqprec": []byte("&#8926;"),
755 "curlyeqsucc": []byte("&#8927;"),
756 "curlyvee": []byte("&#8910;"),
757 "curlywedge": []byte("&#8911;"),
758 "curren": []byte("&#164;"),
759 "curvearrowleft": []byte("&#8630;"),
760 "curvearrowright": []byte("&#8631;"),
761 "cwconint": []byte("&#8754;"),
762 "cylcty": []byte("&#9005;"),
763 "dagger": []byte("&#8224;"),
764 "daleth": []byte("&#8504;"),
765 "dbkarow": []byte("&rBarr;"),
766 "dblac": []byte("&#733;"),
767 "dcaron": []byte("&#271;"),
768 "ddagger": []byte("&#8225;"),
769 "ddotseq": []byte("&eDDot;"),
770 "delta": []byte("&#948;"),
771 "demptyv": []byte("&#10673;"),
772 "diamond": []byte("&diam;"),
773 "diamondsuit": []byte("&#9830;"),
774 "digamma": []byte("&#989;"),
775 "divide": []byte("&div;"),
776 "divideontimes": []byte("&#8903;"),
777 "divonx": []byte("&#8903;"),
778 "dlcorn": []byte("&#8990;"),
779 "dlcrop": []byte("&#8973;"),
780 "dollar": []byte("$"),
781 "doteqdot": []byte("&eDot;"),
782 "dotminus": []byte("&#8760;"),
783 "dotplus": []byte("&#8724;"),
784 "dotsquare": []byte("&#8865;"),
785 "doublebarwedge": []byte("&#8966;"),
786 "downarrow": []byte("&darr;"),
787 "downdownarrows": []byte("&#8650;"),
788 "downharpoonleft": []byte("&#8643;"),
789 "downharpoonright": []byte("&#8642;"),
790 "drbkarow": []byte("&RBarr;"),
791 "drcorn": []byte("&#8991;"),
792 "drcrop": []byte("&#8972;"),
793 "dstrok": []byte("&#273;"),
794 "dwangle": []byte("&#10662;"),
795 "dzigrarr": []byte("&#10239;"),
796 "eacute": []byte("&#233;"),
797 "ecaron": []byte("&#283;"),
798 "ecirc": []byte("&#234;"),
799 "ecolon": []byte("&#8789;"),
800 "egrave": []byte("&#232;"),
801 "elinters": []byte("&#9191;"),
802 "emacr": []byte("&#275;"),
803 "emptyset": []byte("&#8709;"),
804 "emptyv": []byte("&#8709;"),
805 "emsp13": []byte("&#8196;"),
806 "emsp14": []byte("&#8197;"),
807 "eogon": []byte("&#281;"),
808 "epsilon": []byte("&#949;"),
809 "eqcirc": []byte("&ecir;"),
810 "eqcolon": []byte("&#8789;"),
811 "eqsim": []byte("&esim;"),
812 "eqslantgtr": []byte("&egs;"),
813 "eqslantless": []byte("&els;"),
814 "equals": []byte("="),
815 "equest": []byte("&#8799;"),
816 "equivDD": []byte("&#10872;"),
817 "eqvparsl": []byte("&#10725;"),
818 "excl": []byte("!"),
819 "expectation": []byte("&Escr;"),
820 "exponentiale": []byte("&ee;"),
821 "fallingdotseq": []byte("&#8786;"),
822 "female": []byte("&#9792;"),
823 "forall": []byte("&#8704;"),
824 "fpartint": []byte("&#10765;"),
825 "frac12": []byte("&#189;"),
826 "frac13": []byte("&#8531;"),
827 "frac14": []byte("&#188;"),
828 "frac15": []byte("&#8533;"),
829 "frac16": []byte("&#8537;"),
830 "frac18": []byte("&#8539;"),
831 "frac23": []byte("&#8532;"),
832 "frac25": []byte("&#8534;"),
833 "frac34": []byte("&#190;"),
834 "frac35": []byte("&#8535;"),
835 "frac38": []byte("&#8540;"),
836 "frac45": []byte("&#8536;"),
837 "frac56": []byte("&#8538;"),
838 "frac58": []byte("&#8541;"),
839 "frac78": []byte("&#8542;"),
840 "gacute": []byte("&#501;"),
841 "gamma": []byte("&#947;"),
842 "gammad": []byte("&#989;"),
843 "gbreve": []byte("&#287;"),
844 "gcirc": []byte("&#285;"),
845 "geq": []byte("&ge;"),
846 "geqq": []byte("&gE;"),
847 "geqslant": []byte("&ges;"),
848 "gesdoto": []byte("&#10882;"),
849 "gesdotol": []byte("&#10884;"),
850 "ggg": []byte("&Gg;"),
851 "gnapprox": []byte("&gnap;"),
852 "gneq": []byte("&gne;"),
853 "gneqq": []byte("&gnE;"),
854 "grave": []byte("`"),
855 "gt": []byte(">"),
856 "gtquest": []byte("&#10876;"),
857 "gtrapprox": []byte("&gap;"),
858 "gtrdot": []byte("&#8919;"),
859 "gtreqless": []byte("&gel;"),
860 "gtreqqless": []byte("&gEl;"),
861 "gtrless": []byte("&gl;"),
862 "gtrsim": []byte("&gsim;"),
863 "hArr": []byte("&iff;"),
864 "hairsp": []byte("&#8202;"),
865 "hamilt": []byte("&Hscr;"),
866 "hardcy": []byte("&#1098;"),
867 "harrcir": []byte("&#10568;"),
868 "hcirc": []byte("&#293;"),
869 "hearts": []byte("&#9829;"),
870 "heartsuit": []byte("&#9829;"),
871 "hellip": []byte("&mldr;"),
872 "hercon": []byte("&#8889;"),
873 "hksearow": []byte("&#10533;"),
874 "hkswarow": []byte("&#10534;"),
875 "homtht": []byte("&#8763;"),
876 "hookleftarrow": []byte("&#8617;"),
877 "hookrightarrow": []byte("&#8618;"),
878 "horbar": []byte("&#8213;"),
879 "hslash": []byte("&hbar;"),
880 "hstrok": []byte("&#295;"),
881 "hybull": []byte("&#8259;"),
882 "hyphen": []byte("&dash;"),
883 "iacute": []byte("&#237;"),
884 "icirc": []byte("&#238;"),
885 "iexcl": []byte("&#161;"),
886 "igrave": []byte("&#236;"),
887 "iiiint": []byte("&qint;"),
888 "iiint": []byte("&tint;"),
889 "ijlig": []byte("&#307;"),
890 "imacr": []byte("&#299;"),
891 "image": []byte("&Im;"),
892 "imagline": []byte("&Iscr;"),
893 "imagpart": []byte("&Im;"),
894 "imath": []byte("&#305;"),
895 "imped": []byte("&#437;"),
896 "incare": []byte("&#8453;"),
897 "infintie": []byte("&#10717;"),
898 "inodot": []byte("&#305;"),
899 "intcal": []byte("&#8890;"),
900 "integers": []byte("&Zopf;"),
901 "intercal": []byte("&#8890;"),
902 "intlarhk": []byte("&#10775;"),
903 "intprod": []byte("&iprod;"),
904 "iogon": []byte("&#303;"),
905 "iquest": []byte("&#191;"),
906 "isin": []byte("&in;"),
907 "isindot": []byte("&#8949;"),
908 "isinsv": []byte("&#8947;"),
909 "isinv": []byte("&in;"),
910 "itilde": []byte("&#297;"),
911 "jcirc": []byte("&#309;"),
912 "jmath": []byte("&#567;"),
913 "jsercy": []byte("&#1112;"),
914 "kappa": []byte("&#954;"),
915 "kappav": []byte("&#1008;"),
916 "kcedil": []byte("&#311;"),
917 "kgreen": []byte("&#312;"),
918 "lacute": []byte("&#314;"),
919 "laemptyv": []byte("&#10676;"),
920 "lagran": []byte("&Lscr;"),
921 "lambda": []byte("&#955;"),
922 "langle": []byte("&lang;"),
923 "laquo": []byte("&#171;"),
924 "larrbfs": []byte("&#10527;"),
925 "larrhk": []byte("&#8617;"),
926 "larrlp": []byte("&#8619;"),
927 "larrsim": []byte("&#10611;"),
928 "larrtl": []byte("&#8610;"),
929 "lbrace": []byte("{"),
930 "lbrack": []byte("["),
931 "lbrksld": []byte("&#10639;"),
932 "lbrkslu": []byte("&#10637;"),
933 "lcaron": []byte("&#318;"),
934 "lcedil": []byte("&#316;"),
935 "lcub": []byte("{"),
936 "ldquor": []byte("&#8222;"),
937 "ldrdhar": []byte("&#10599;"),
938 "ldrushar": []byte("&#10571;"),
939 "leftarrow": []byte("&larr;"),
940 "leftarrowtail": []byte("&#8610;"),
941 "leftharpoondown": []byte("&#8637;"),
942 "leftharpoonup": []byte("&#8636;"),
943 "leftleftarrows": []byte("&#8647;"),
944 "leftrightarrow": []byte("&harr;"),
945 "leftrightarrows": []byte("&#8646;"),
946 "leftrightharpoons": []byte("&#8651;"),
947 "leftrightsquigarrow": []byte("&#8621;"),
948 "leftthreetimes": []byte("&#8907;"),
949 "leq": []byte("&le;"),
950 "leqq": []byte("&lE;"),
951 "leqslant": []byte("&les;"),
952 "lesdoto": []byte("&#10881;"),
953 "lesdotor": []byte("&#10883;"),
954 "lessapprox": []byte("&lap;"),
955 "lessdot": []byte("&#8918;"),
956 "lesseqgtr": []byte("&leg;"),
957 "lesseqqgtr": []byte("&lEg;"),
958 "lessgtr": []byte("&lg;"),
959 "lesssim": []byte("&lsim;"),
960 "lfloor": []byte("&#8970;"),
961 "llcorner": []byte("&#8990;"),
962 "lmidot": []byte("&#320;"),
963 "lmoust": []byte("&#9136;"),
964 "lmoustache": []byte("&#9136;"),
965 "lnapprox": []byte("&lnap;"),
966 "lneq": []byte("&lne;"),
967 "lneqq": []byte("&lnE;"),
968 "longleftarrow": []byte("&xlarr;"),
969 "longleftrightarrow": []byte("&xharr;"),
970 "longmapsto": []byte("&xmap;"),
971 "longrightarrow": []byte("&xrarr;"),
972 "looparrowleft": []byte("&#8619;"),
973 "looparrowright": []byte("&#8620;"),
974 "lotimes": []byte("&#10804;"),
975 "lowast": []byte("&#8727;"),
976 "lowbar": []byte("_"),
977 "lozenge": []byte("&loz;"),
978 "lpar": []byte("("),
979 "lrcorner": []byte("&#8991;"),
980 "lsaquo": []byte("&#8249;"),
981 "lsqb": []byte("["),
982 "lsquor": []byte("&#8218;"),
983 "lstrok": []byte("&#322;"),
984 "lt": []byte("<"),
985 "lthree": []byte("&#8907;"),
986 "ltimes": []byte("&#8905;"),
987 "ltquest": []byte("&#10875;"),
988 "lurdshar": []byte("&#10570;"),
989 "luruhar": []byte("&#10598;"),
990 "maltese": []byte("&malt;"),
991 "mapsto": []byte("&map;"),
992 "mapstodown": []byte("&#8615;"),
993 "mapstoleft": []byte("&#8612;"),
994 "mapstoup": []byte("&#8613;"),
995 "marker": []byte("&#9646;"),
996 "measuredangle": []byte("&#8737;"),
997 "micro": []byte("&#181;"),
998 "midast": []byte("*"),
999 "middot": []byte("&#183;"),
1000 "minusb": []byte("&#8863;"),
1001 "minusd": []byte("&#8760;"),
1002 "minusdu": []byte("&#10794;"),
1003 "mnplus": []byte("&mp;"),
1004 "models": []byte("&#8871;"),
1005 "mstpos": []byte("&ac;"),
1006 "multimap": []byte("&#8888;"),
1007 "nLeftarrow": []byte("&#8653;"),
1008 "nLeftrightarrow": []byte("&#8654;"),
1009 "nRightarrow": []byte("&#8655;"),
1010 "nVDash": []byte("&#8879;"),
1011 "nVdash": []byte("&#8878;"),
1012 "nabla": []byte("&Del;"),
1013 "nacute": []byte("&#324;"),
1014 "napos": []byte("&#329;"),
1015 "napprox": []byte("&nap;"),
1016 "natural": []byte("&#9838;"),
1017 "naturals": []byte("&Nopf;"),
1018 "ncaron": []byte("&#328;"),
1019 "ncedil": []byte("&#326;"),
1020 "nearrow": []byte("&#8599;"),
1021 "nequiv": []byte("&#8802;"),
1022 "nesear": []byte("&toea;"),
1023 "nexist": []byte("&#8708;"),
1024 "nexists": []byte("&#8708;"),
1025 "ngeq": []byte("&nge;"),
1026 "ngtr": []byte("&ngt;"),
1027 "niv": []byte("&ni;"),
1028 "nleftarrow": []byte("&#8602;"),
1029 "nleftrightarrow": []byte("&#8622;"),
1030 "nleq": []byte("&nle;"),
1031 "nless": []byte("&nlt;"),
1032 "nltrie": []byte("&#8940;"),
1033 "notinva": []byte("&#8713;"),
1034 "notinvb": []byte("&#8951;"),
1035 "notinvc": []byte("&#8950;"),
1036 "notniva": []byte("&#8716;"),
1037 "notnivb": []byte("&#8958;"),
1038 "notnivc": []byte("&#8957;"),
1039 "nparallel": []byte("&npar;"),
1040 "npolint": []byte("&#10772;"),
1041 "nprcue": []byte("&#8928;"),
1042 "nprec": []byte("&npr;"),
1043 "nrightarrow": []byte("&#8603;"),
1044 "nrtrie": []byte("&#8941;"),
1045 "nsccue": []byte("&#8929;"),
1046 "nshortmid": []byte("&nmid;"),
1047 "nshortparallel": []byte("&npar;"),
1048 "nsimeq": []byte("&#8772;"),
1049 "nsmid": []byte("&nmid;"),
1050 "nspar": []byte("&npar;"),
1051 "nsqsube": []byte("&#8930;"),
1052 "nsqsupe": []byte("&#8931;"),
1053 "nsubseteq": []byte("&#8840;"),
1054 "nsucc": []byte("&nsc;"),
1055 "nsupseteq": []byte("&#8841;"),
1056 "ntilde": []byte("&#241;"),
1057 "ntriangleleft": []byte("&#8938;"),
1058 "ntrianglelefteq": []byte("&#8940;"),
1059 "ntriangleright": []byte("&#8939;"),
1060 "ntrianglerighteq": []byte("&#8941;"),
1061 "num": []byte("#"),
1062 "numero": []byte("&#8470;"),
1063 "nvDash": []byte("&#8877;"),
1064 "nvdash": []byte("&#8876;"),
1065 "nvinfin": []byte("&#10718;"),
1066 "nwarrow": []byte("&#8598;"),
1067 "oacute": []byte("&#243;"),
1068 "ocirc": []byte("&#244;"),
1069 "odblac": []byte("&#337;"),
1070 "oelig": []byte("&#339;"),
1071 "ograve": []byte("&#242;"),
1072 "olcross": []byte("&#10683;"),
1073 "omacr": []byte("&#333;"),
1074 "omega": []byte("&#969;"),
1075 "omicron": []byte("&#959;"),
1076 "ominus": []byte("&#8854;"),
1077 "order": []byte("&oscr;"),
1078 "orderof": []byte("&oscr;"),
1079 "origof": []byte("&#8886;"),
1080 "orslope": []byte("&#10839;"),
1081 "oslash": []byte("&#248;"),
1082 "otilde": []byte("&#245;"),
1083 "otimes": []byte("&#8855;"),
1084 "otimesas": []byte("&#10806;"),
1085 "parallel": []byte("&par;"),
1086 "percnt": []byte("%"),
1087 "period": []byte("."),
1088 "permil": []byte("&#8240;"),
1089 "perp": []byte("&bot;"),
1090 "pertenk": []byte("&#8241;"),
1091 "phmmat": []byte("&Mscr;"),
1092 "pitchfork": []byte("&fork;"),
1093 "planck": []byte("&hbar;"),
1094 "planckh": []byte("&#8462;"),
1095 "plankv": []byte("&hbar;"),
1096 "plus": []byte("+"),
1097 "plusacir": []byte("&#10787;"),
1098 "pluscir": []byte("&#10786;"),
1099 "plusdo": []byte("&#8724;"),
1100 "plusmn": []byte("&pm;"),
1101 "plussim": []byte("&#10790;"),
1102 "plustwo": []byte("&#10791;"),
1103 "pointint": []byte("&#10773;"),
1104 "pound": []byte("&#163;"),
1105 "prec": []byte("&pr;"),
1106 "precapprox": []byte("&prap;"),
1107 "preccurlyeq": []byte("&#8828;"),
1108 "preceq": []byte("&pre;"),
1109 "precnapprox": []byte("&prnap;"),
1110 "precneqq": []byte("&prnE;"),
1111 "precnsim": []byte("&#8936;"),
1112 "precsim": []byte("&#8830;"),
1113 "primes": []byte("&Popf;"),
1114 "prnsim": []byte("&#8936;"),
1115 "profalar": []byte("&#9006;"),
1116 "profline": []byte("&#8978;"),
1117 "profsurf": []byte("&#8979;"),
1118 "propto": []byte("&prop;"),
1119 "prurel": []byte("&#8880;"),
1120 "puncsp": []byte("&#8200;"),
1121 "qprime": []byte("&#8279;"),
1122 "quaternions": []byte("&Hopf;"),
1123 "quatint": []byte("&#10774;"),
1124 "quest": []byte("?"),
1125 "questeq": []byte("&#8799;"),
1126 "quot": []byte("\""),
1127 "racute": []byte("&#341;"),
1128 "radic": []byte("&Sqrt;"),
1129 "raemptyv": []byte("&#10675;"),
1130 "rangle": []byte("&rang;"),
1131 "raquo": []byte("&#187;"),
1132 "rarrbfs": []byte("&#10528;"),
1133 "rarrhk": []byte("&#8618;"),
1134 "rarrlp": []byte("&#8620;"),
1135 "rarrsim": []byte("&#10612;"),
1136 "rarrtl": []byte("&#8611;"),
1137 "rationals": []byte("&Qopf;"),
1138 "rbrace": []byte("}"),
1139 "rbrack": []byte("]"),
1140 "rbrksld": []byte("&#10638;"),
1141 "rbrkslu": []byte("&#10640;"),
1142 "rcaron": []byte("&#345;"),
1143 "rcedil": []byte("&#343;"),
1144 "rcub": []byte("}"),
1145 "rdldhar": []byte("&#10601;"),
1146 "rdquor": []byte("&#8221;"),
1147 "real": []byte("&Re;"),
1148 "realine": []byte("&Rscr;"),
1149 "realpart": []byte("&Re;"),
1150 "reals": []byte("&Ropf;"),
1151 "rfloor": []byte("&#8971;"),
1152 "rightarrow": []byte("&rarr;"),
1153 "rightarrowtail": []byte("&#8611;"),
1154 "rightharpoondown": []byte("&#8641;"),
1155 "rightharpoonup": []byte("&#8640;"),
1156 "rightleftarrows": []byte("&#8644;"),
1157 "rightleftharpoons": []byte("&#8652;"),
1158 "rightrightarrows": []byte("&#8649;"),
1159 "rightsquigarrow": []byte("&#8605;"),
1160 "rightthreetimes": []byte("&#8908;"),
1161 "risingdotseq": []byte("&#8787;"),
1162 "rmoust": []byte("&#9137;"),
1163 "rmoustache": []byte("&#9137;"),
1164 "rotimes": []byte("&#10805;"),
1165 "rpar": []byte(")"),
1166 "rppolint": []byte("&#10770;"),
1167 "rsaquo": []byte("&#8250;"),
1168 "rsqb": []byte("]"),
1169 "rsquor": []byte("&#8217;"),
1170 "rthree": []byte("&#8908;"),
1171 "rtimes": []byte("&#8906;"),
1172 "rtriltri": []byte("&#10702;"),
1173 "ruluhar": []byte("&#10600;"),
1174 "sacute": []byte("&#347;"),
1175 "scaron": []byte("&#353;"),
1176 "scedil": []byte("&#351;"),
1177 "scirc": []byte("&#349;"),
1178 "scnsim": []byte("&#8937;"),
1179 "scpolint": []byte("&#10771;"),
1180 "searrow": []byte("&#8600;"),
1181 "semi": []byte(";"),
1182 "seswar": []byte("&tosa;"),
1183 "setminus": []byte("&#8726;"),
1184 "sfrown": []byte("&#8994;"),
1185 "shchcy": []byte("&#1097;"),
1186 "shortmid": []byte("&mid;"),
1187 "shortparallel": []byte("&par;"),
1188 "sigma": []byte("&#963;"),
1189 "sigmaf": []byte("&#962;"),
1190 "sigmav": []byte("&#962;"),
1191 "simeq": []byte("&sime;"),
1192 "simplus": []byte("&#10788;"),
1193 "simrarr": []byte("&#10610;"),
1194 "slarr": []byte("&larr;"),
1195 "smallsetminus": []byte("&#8726;"),
1196 "smeparsl": []byte("&#10724;"),
1197 "smid": []byte("&mid;"),
1198 "softcy": []byte("&#1100;"),
1199 "sol": []byte("/"),
1200 "solbar": []byte("&#9023;"),
1201 "spades": []byte("&#9824;"),
1202 "spadesuit": []byte("&#9824;"),
1203 "spar": []byte("&par;"),
1204 "sqsube": []byte("&#8849;"),
1205 "sqsubset": []byte("&#8847;"),
1206 "sqsubseteq": []byte("&#8849;"),
1207 "sqsupe": []byte("&#8850;"),
1208 "sqsupset": []byte("&#8848;"),
1209 "sqsupseteq": []byte("&#8850;"),
1210 "square": []byte("&squ;"),
1211 "squarf": []byte("&squf;"),
1212 "srarr": []byte("&rarr;"),
1213 "ssetmn": []byte("&#8726;"),
1214 "ssmile": []byte("&#8995;"),
1215 "sstarf": []byte("&Star;"),
1216 "straightepsilon": []byte("&#1013;"),
1217 "straightphi": []byte("&#981;"),
1218 "strns": []byte("&#175;"),
1219 "subedot": []byte("&#10947;"),
1220 "submult": []byte("&#10945;"),
1221 "subplus": []byte("&#10943;"),
1222 "subrarr": []byte("&#10617;"),
1223 "subset": []byte("&sub;"),
1224 "subseteq": []byte("&sube;"),
1225 "subseteqq": []byte("&subE;"),
1226 "subsetneq": []byte("&#8842;"),
1227 "subsetneqq": []byte("&subnE;"),
1228 "succ": []byte("&sc;"),
1229 "succapprox": []byte("&scap;"),
1230 "succcurlyeq": []byte("&#8829;"),
1231 "succeq": []byte("&sce;"),
1232 "succnapprox": []byte("&scnap;"),
1233 "succneqq": []byte("&scnE;"),
1234 "succnsim": []byte("&#8937;"),
1235 "succsim": []byte("&#8831;"),
1236 "supdsub": []byte("&#10968;"),
1237 "supedot": []byte("&#10948;"),
1238 "suphsol": []byte("&#10185;"),
1239 "suphsub": []byte("&#10967;"),
1240 "suplarr": []byte("&#10619;"),
1241 "supmult": []byte("&#10946;"),
1242 "supplus": []byte("&#10944;"),
1243 "supset": []byte("&sup;"),
1244 "supseteq": []byte("&supe;"),
1245 "supseteqq": []byte("&supE;"),
1246 "supsetneq": []byte("&#8843;"),
1247 "supsetneqq": []byte("&supnE;"),
1248 "swarrow": []byte("&#8601;"),
1249 "szlig": []byte("&#223;"),
1250 "target": []byte("&#8982;"),
1251 "tcaron": []byte("&#357;"),
1252 "tcedil": []byte("&#355;"),
1253 "telrec": []byte("&#8981;"),
1254 "there4": []byte("&#8756;"),
1255 "therefore": []byte("&#8756;"),
1256 "theta": []byte("&#952;"),
1257 "thetasym": []byte("&#977;"),
1258 "thetav": []byte("&#977;"),
1259 "thickapprox": []byte("&ap;"),
1260 "thicksim": []byte("&sim;"),
1261 "thinsp": []byte("&#8201;"),
1262 "thkap": []byte("&ap;"),
1263 "thksim": []byte("&sim;"),
1264 "thorn": []byte("&#254;"),
1265 "tilde": []byte("&#732;"),
1266 "times": []byte("&#215;"),
1267 "timesb": []byte("&#8864;"),
1268 "timesbar": []byte("&#10801;"),
1269 "topbot": []byte("&#9014;"),
1270 "topfork": []byte("&#10970;"),
1271 "tprime": []byte("&#8244;"),
1272 "triangle": []byte("&utri;"),
1273 "triangledown": []byte("&dtri;"),
1274 "triangleleft": []byte("&ltri;"),
1275 "trianglelefteq": []byte("&#8884;"),
1276 "triangleq": []byte("&trie;"),
1277 "triangleright": []byte("&rtri;"),
1278 "trianglerighteq": []byte("&#8885;"),
1279 "tridot": []byte("&#9708;"),
1280 "triminus": []byte("&#10810;"),
1281 "triplus": []byte("&#10809;"),
1282 "tritime": []byte("&#10811;"),
1283 "trpezium": []byte("&#9186;"),
1284 "tstrok": []byte("&#359;"),
1285 "twoheadleftarrow": []byte("&Larr;"),
1286 "twoheadrightarrow": []byte("&Rarr;"),
1287 "uacute": []byte("&#250;"),
1288 "ubreve": []byte("&#365;"),
1289 "ucirc": []byte("&#251;"),
1290 "udblac": []byte("&#369;"),
1291 "ugrave": []byte("&#249;"),
1292 "ulcorn": []byte("&#8988;"),
1293 "ulcorner": []byte("&#8988;"),
1294 "ulcrop": []byte("&#8975;"),
1295 "umacr": []byte("&#363;"),
1296 "uogon": []byte("&#371;"),
1297 "uparrow": []byte("&uarr;"),
1298 "updownarrow": []byte("&varr;"),
1299 "upharpoonleft": []byte("&#8639;"),
1300 "upharpoonright": []byte("&#8638;"),
1301 "upsih": []byte("&#978;"),
1302 "upsilon": []byte("&#965;"),
1303 "upuparrows": []byte("&#8648;"),
1304 "urcorn": []byte("&#8989;"),
1305 "urcorner": []byte("&#8989;"),
1306 "urcrop": []byte("&#8974;"),
1307 "uring": []byte("&#367;"),
1308 "utilde": []byte("&#361;"),
1309 "uwangle": []byte("&#10663;"),
1310 "varepsilon": []byte("&#1013;"),
1311 "varkappa": []byte("&#1008;"),
1312 "varnothing": []byte("&#8709;"),
1313 "varphi": []byte("&#981;"),
1314 "varpi": []byte("&piv;"),
1315 "varpropto": []byte("&prop;"),
1316 "varrho": []byte("&rhov;"),
1317 "varsigma": []byte("&#962;"),
1318 "vartheta": []byte("&#977;"),
1319 "vartriangleleft": []byte("&#8882;"),
1320 "vartriangleright": []byte("&#8883;"),
1321 "vee": []byte("&or;"),
1322 "veebar": []byte("&#8891;"),
1323 "vellip": []byte("&#8942;"),
1324 "verbar": []byte("|"),
1325 "vert": []byte("|"),
1326 "vprop": []byte("&prop;"),
1327 "vzigzag": []byte("&#10650;"),
1328 "wcirc": []byte("&#373;"),
1329 "wedge": []byte("&and;"),
1330 "wedgeq": []byte("&#8793;"),
1331 "weierp": []byte("&wp;"),
1332 "wreath": []byte("&wr;"),
1333 "xvee": []byte("&Vee;"),
1334 "xwedge": []byte("&#8896;"),
1335 "yacute": []byte("&#253;"),
1336 "ycirc": []byte("&#375;"),
1337 "zacute": []byte("&#378;"),
1338 "zcaron": []byte("&#382;"),
1339 "zeetrf": []byte("&Zfr;"),
1340 "zigrarr": []byte("&#8669;"),
1341}
1342
1343// TextRevEntitiesMap is a map of escapes.
1344var TextRevEntitiesMap = map[byte][]byte{
1345 '<': []byte("&lt;"),
1346}