@@ -4,60 +4,60 @@ import Foundation
44
55/// Void elements that have no closing tag
66let VOID_ELEMENTS : Set < String > = [
7- " area " , " base " , " br " , " col " , " embed " , " hr " , " img " , " input " ,
8- " link " , " meta " , " param " , " source " , " track " , " wbr " ,
7+ " area " , " base " , " br " , " col " , " embed " , " hr " , " img " , " input " ,
8+ " link " , " meta " , " param " , " source " , " track " , " wbr " ,
99]
1010
1111/// Raw text elements (contents not parsed as HTML)
1212let RAW_TEXT_ELEMENTS : Set < String > = [
13- " script " , " style " ,
13+ " script " , " style " ,
1414]
1515
1616/// Escapable raw text elements
1717let ESCAPABLE_RAW_TEXT_ELEMENTS : Set < String > = [
18- " textarea " , " title " ,
18+ " textarea " , " title " ,
1919]
2020
2121/// Formatting elements for the adoption agency algorithm
2222let FORMATTING_ELEMENTS : Set < String > = [
23- " a " , " b " , " big " , " code " , " em " , " font " , " i " , " nobr " ,
24- " s " , " small " , " strike " , " strong " , " tt " , " u " ,
23+ " a " , " b " , " big " , " code " , " em " , " font " , " i " , " nobr " ,
24+ " s " , " small " , " strike " , " strong " , " tt " , " u " ,
2525]
2626
2727/// Special elements that have special parsing rules
2828let SPECIAL_ELEMENTS : Set < String > = [
29- " address " , " applet " , " area " , " article " , " aside " , " base " , " basefont " ,
30- " bgsound " , " blockquote " , " body " , " br " , " button " , " caption " , " center " ,
31- " col " , " colgroup " , " dd " , " details " , " dir " , " div " , " dl " , " dt " , " embed " ,
32- " fieldset " , " figcaption " , " figure " , " footer " , " form " , " frame " , " frameset " ,
33- " h1 " , " h2 " , " h3 " , " h4 " , " h5 " , " h6 " , " head " , " header " , " hgroup " , " hr " ,
34- " html " , " iframe " , " img " , " input " , " keygen " , " li " , " link " , " listing " ,
35- " main " , " marquee " , " menu " , " meta " , " nav " , " noembed " , " noframes " ,
36- " noscript " , " object " , " ol " , " p " , " param " , " plaintext " , " pre " , " script " ,
37- " search " , " section " , " select " , " source " , " style " , " summary " , " table " ,
38- " tbody " , " td " , " template " , " textarea " , " tfoot " , " th " , " thead " , " title " ,
39- " tr " , " track " , " ul " , " wbr " , " xmp " ,
29+ " address " , " applet " , " area " , " article " , " aside " , " base " , " basefont " ,
30+ " bgsound " , " blockquote " , " body " , " br " , " button " , " caption " , " center " ,
31+ " col " , " colgroup " , " dd " , " details " , " dir " , " div " , " dl " , " dt " , " embed " ,
32+ " fieldset " , " figcaption " , " figure " , " footer " , " form " , " frame " , " frameset " ,
33+ " h1 " , " h2 " , " h3 " , " h4 " , " h5 " , " h6 " , " head " , " header " , " hgroup " , " hr " ,
34+ " html " , " iframe " , " img " , " input " , " keygen " , " li " , " link " , " listing " ,
35+ " main " , " marquee " , " menu " , " meta " , " nav " , " noembed " , " noframes " ,
36+ " noscript " , " object " , " ol " , " p " , " param " , " plaintext " , " pre " , " script " ,
37+ " search " , " section " , " select " , " source " , " style " , " summary " , " table " ,
38+ " tbody " , " td " , " template " , " textarea " , " tfoot " , " th " , " thead " , " title " ,
39+ " tr " , " track " , " ul " , " wbr " , " xmp " ,
4040]
4141
4242/// Elements that imply closing a <p> element
4343let P_CLOSING_ELEMENTS : Set < String > = [
44- " address " , " article " , " aside " , " blockquote " , " center " , " details " ,
45- " dialog " , " dir " , " div " , " dl " , " fieldset " , " figcaption " , " figure " ,
46- " footer " , " form " , " h1 " , " h2 " , " h3 " , " h4 " , " h5 " , " h6 " , " header " ,
47- " hgroup " , " hr " , " main " , " menu " , " nav " , " ol " , " p " , " pre " , " search " ,
48- " section " , " table " , " ul " ,
44+ " address " , " article " , " aside " , " blockquote " , " center " , " details " ,
45+ " dialog " , " dir " , " div " , " dl " , " fieldset " , " figcaption " , " figure " ,
46+ " footer " , " form " , " h1 " , " h2 " , " h3 " , " h4 " , " h5 " , " h6 " , " header " ,
47+ " hgroup " , " hr " , " main " , " menu " , " nav " , " ol " , " p " , " pre " , " search " ,
48+ " section " , " table " , " ul " ,
4949]
5050
5151/// Scope elements for checking element scope
5252/// HTML namespace: applet, caption, html, table, td, th, marquee, object, template
5353/// MathML namespace: mi, mo, mn, ms, mtext, annotation-xml
5454/// SVG namespace: foreignObject, desc, title
5555let SCOPE_ELEMENTS : Set < String > = [
56- " applet " , " caption " , " html " , " table " , " td " , " th " , " marquee " , " object " , " template " ,
57- // MathML elements (namespace-specific but we match by name)
58- " mi " , " mo " , " mn " , " ms " , " mtext " , " annotation-xml " ,
59- // SVG elements (namespace-specific but we match by name)
60- " foreignObject " , " desc " , " title " ,
56+ " applet " , " caption " , " html " , " table " , " td " , " th " , " marquee " , " object " , " template " ,
57+ // MathML elements (namespace-specific but we match by name)
58+ " mi " , " mo " , " mn " , " ms " , " mtext " , " annotation-xml " ,
59+ // SVG elements (namespace-specific but we match by name)
60+ " foreignObject " , " desc " , " title " ,
6161]
6262
6363/// List item scope elements
@@ -73,11 +73,11 @@ let TABLE_SCOPE_ELEMENTS: Set<String> = ["html", "table", "template"]
7373
7474/// Scope elements for checking element scope (TagID version)
7575let SCOPE_ELEMENTS_ID : Set < TagID > = [
76- . applet, . caption, . html, . table, . td, . th, . marquee, . object, . template,
77- // MathML elements
78- . mi, . mo, . mn, . ms, . mtext, . annotationXml,
79- // SVG elements
80- . foreignObject, . desc, . title,
76+ . applet, . caption, . html, . table, . td, . th, . marquee, . object, . template,
77+ // MathML elements
78+ . mi, . mo, . mn, . ms, . mtext, . annotationXml,
79+ // SVG elements
80+ . foreignObject, . desc, . title,
8181]
8282
8383/// List item scope elements (TagID version)
@@ -91,135 +91,135 @@ let TABLE_SCOPE_ELEMENTS_ID: Set<TagID> = [.html, .table, .template]
9191
9292/// Elements that are implicitly closed by certain other elements
9393let IMPLIED_END_TAGS : Set < String > = [
94- " dd " , " dt " , " li " , " optgroup " , " option " , " p " , " rb " , " rp " , " rt " , " rtc " ,
94+ " dd " , " dt " , " li " , " optgroup " , " option " , " p " , " rb " , " rp " , " rt " , " rtc " ,
9595]
9696
9797/// Thoroughly implied end tags (includes more elements)
9898let THOROUGHLY_IMPLIED_END_TAGS : Set < String > = IMPLIED_END_TAGS . union ( [
99- " caption " , " colgroup " , " tbody " , " td " , " tfoot " , " th " , " thead " , " tr " ,
99+ " caption " , " colgroup " , " tbody " , " td " , " tfoot " , " th " , " thead " , " tr " ,
100100] )
101101
102102/// SVG element case adjustments
103103let SVG_ELEMENT_ADJUSTMENTS : [ String : String ] = [
104- " altglyph " : " altGlyph " ,
105- " altglyphdef " : " altGlyphDef " ,
106- " altglyphitem " : " altGlyphItem " ,
107- " animatecolor " : " animateColor " ,
108- " animatemotion " : " animateMotion " ,
109- " animatetransform " : " animateTransform " ,
110- " clippath " : " clipPath " ,
111- " feblend " : " feBlend " ,
112- " fecolormatrix " : " feColorMatrix " ,
113- " fecomponenttransfer " : " feComponentTransfer " ,
114- " fecomposite " : " feComposite " ,
115- " feconvolvematrix " : " feConvolveMatrix " ,
116- " fediffuselighting " : " feDiffuseLighting " ,
117- " fedisplacementmap " : " feDisplacementMap " ,
118- " fedistantlight " : " feDistantLight " ,
119- " fedropshadow " : " feDropShadow " ,
120- " feflood " : " feFlood " ,
121- " fefunca " : " feFuncA " ,
122- " fefuncb " : " feFuncB " ,
123- " fefuncg " : " feFuncG " ,
124- " fefuncr " : " feFuncR " ,
125- " fegaussianblur " : " feGaussianBlur " ,
126- " feimage " : " feImage " ,
127- " femerge " : " feMerge " ,
128- " femergenode " : " feMergeNode " ,
129- " femorphology " : " feMorphology " ,
130- " feoffset " : " feOffset " ,
131- " fepointlight " : " fePointLight " ,
132- " fespecularlighting " : " feSpecularLighting " ,
133- " fespotlight " : " feSpotLight " ,
134- " fetile " : " feTile " ,
135- " feturbulence " : " feTurbulence " ,
136- " foreignobject " : " foreignObject " ,
137- " glyphref " : " glyphRef " ,
138- " lineargradient " : " linearGradient " ,
139- " radialgradient " : " radialGradient " ,
140- " textpath " : " textPath " ,
104+ " altglyph " : " altGlyph " ,
105+ " altglyphdef " : " altGlyphDef " ,
106+ " altglyphitem " : " altGlyphItem " ,
107+ " animatecolor " : " animateColor " ,
108+ " animatemotion " : " animateMotion " ,
109+ " animatetransform " : " animateTransform " ,
110+ " clippath " : " clipPath " ,
111+ " feblend " : " feBlend " ,
112+ " fecolormatrix " : " feColorMatrix " ,
113+ " fecomponenttransfer " : " feComponentTransfer " ,
114+ " fecomposite " : " feComposite " ,
115+ " feconvolvematrix " : " feConvolveMatrix " ,
116+ " fediffuselighting " : " feDiffuseLighting " ,
117+ " fedisplacementmap " : " feDisplacementMap " ,
118+ " fedistantlight " : " feDistantLight " ,
119+ " fedropshadow " : " feDropShadow " ,
120+ " feflood " : " feFlood " ,
121+ " fefunca " : " feFuncA " ,
122+ " fefuncb " : " feFuncB " ,
123+ " fefuncg " : " feFuncG " ,
124+ " fefuncr " : " feFuncR " ,
125+ " fegaussianblur " : " feGaussianBlur " ,
126+ " feimage " : " feImage " ,
127+ " femerge " : " feMerge " ,
128+ " femergenode " : " feMergeNode " ,
129+ " femorphology " : " feMorphology " ,
130+ " feoffset " : " feOffset " ,
131+ " fepointlight " : " fePointLight " ,
132+ " fespecularlighting " : " feSpecularLighting " ,
133+ " fespotlight " : " feSpotLight " ,
134+ " fetile " : " feTile " ,
135+ " feturbulence " : " feTurbulence " ,
136+ " foreignobject " : " foreignObject " ,
137+ " glyphref " : " glyphRef " ,
138+ " lineargradient " : " linearGradient " ,
139+ " radialgradient " : " radialGradient " ,
140+ " textpath " : " textPath " ,
141141]
142142
143143/// SVG attribute case adjustments
144144let SVG_ATTRIBUTE_ADJUSTMENTS : [ String : String ] = [
145- " attributename " : " attributeName " ,
146- " attributetype " : " attributeType " ,
147- " basefrequency " : " baseFrequency " ,
148- " baseprofile " : " baseProfile " ,
149- " calcmode " : " calcMode " ,
150- " clippathunits " : " clipPathUnits " ,
151- " diffuseconstant " : " diffuseConstant " ,
152- " edgemode " : " edgeMode " ,
153- " filterunits " : " filterUnits " ,
154- " glyphref " : " glyphRef " ,
155- " gradienttransform " : " gradientTransform " ,
156- " gradientunits " : " gradientUnits " ,
157- " kernelmatrix " : " kernelMatrix " ,
158- " kernelunitlength " : " kernelUnitLength " ,
159- " keypoints " : " keyPoints " ,
160- " keysplines " : " keySplines " ,
161- " keytimes " : " keyTimes " ,
162- " lengthadjust " : " lengthAdjust " ,
163- " limitingconeangle " : " limitingConeAngle " ,
164- " markerheight " : " markerHeight " ,
165- " markerunits " : " markerUnits " ,
166- " markerwidth " : " markerWidth " ,
167- " maskcontentunits " : " maskContentUnits " ,
168- " maskunits " : " maskUnits " ,
169- " numoctaves " : " numOctaves " ,
170- " pathlength " : " pathLength " ,
171- " patterncontentunits " : " patternContentUnits " ,
172- " patterntransform " : " patternTransform " ,
173- " patternunits " : " patternUnits " ,
174- " pointsatx " : " pointsAtX " ,
175- " pointsaty " : " pointsAtY " ,
176- " pointsatz " : " pointsAtZ " ,
177- " preservealpha " : " preserveAlpha " ,
178- " preserveaspectratio " : " preserveAspectRatio " ,
179- " primitiveunits " : " primitiveUnits " ,
180- " refx " : " refX " ,
181- " refy " : " refY " ,
182- " repeatcount " : " repeatCount " ,
183- " repeatdur " : " repeatDur " ,
184- " requiredextensions " : " requiredExtensions " ,
185- " requiredfeatures " : " requiredFeatures " ,
186- " specularconstant " : " specularConstant " ,
187- " specularexponent " : " specularExponent " ,
188- " spreadmethod " : " spreadMethod " ,
189- " startoffset " : " startOffset " ,
190- " stddeviation " : " stdDeviation " ,
191- " stitchtiles " : " stitchTiles " ,
192- " surfacescale " : " surfaceScale " ,
193- " systemlanguage " : " systemLanguage " ,
194- " tablevalues " : " tableValues " ,
195- " targetx " : " targetX " ,
196- " targety " : " targetY " ,
197- " textlength " : " textLength " ,
198- " viewbox " : " viewBox " ,
199- " viewtarget " : " viewTarget " ,
200- " xchannelselector " : " xChannelSelector " ,
201- " ychannelselector " : " yChannelSelector " ,
202- " zoomandpan " : " zoomAndPan " ,
145+ " attributename " : " attributeName " ,
146+ " attributetype " : " attributeType " ,
147+ " basefrequency " : " baseFrequency " ,
148+ " baseprofile " : " baseProfile " ,
149+ " calcmode " : " calcMode " ,
150+ " clippathunits " : " clipPathUnits " ,
151+ " diffuseconstant " : " diffuseConstant " ,
152+ " edgemode " : " edgeMode " ,
153+ " filterunits " : " filterUnits " ,
154+ " glyphref " : " glyphRef " ,
155+ " gradienttransform " : " gradientTransform " ,
156+ " gradientunits " : " gradientUnits " ,
157+ " kernelmatrix " : " kernelMatrix " ,
158+ " kernelunitlength " : " kernelUnitLength " ,
159+ " keypoints " : " keyPoints " ,
160+ " keysplines " : " keySplines " ,
161+ " keytimes " : " keyTimes " ,
162+ " lengthadjust " : " lengthAdjust " ,
163+ " limitingconeangle " : " limitingConeAngle " ,
164+ " markerheight " : " markerHeight " ,
165+ " markerunits " : " markerUnits " ,
166+ " markerwidth " : " markerWidth " ,
167+ " maskcontentunits " : " maskContentUnits " ,
168+ " maskunits " : " maskUnits " ,
169+ " numoctaves " : " numOctaves " ,
170+ " pathlength " : " pathLength " ,
171+ " patterncontentunits " : " patternContentUnits " ,
172+ " patterntransform " : " patternTransform " ,
173+ " patternunits " : " patternUnits " ,
174+ " pointsatx " : " pointsAtX " ,
175+ " pointsaty " : " pointsAtY " ,
176+ " pointsatz " : " pointsAtZ " ,
177+ " preservealpha " : " preserveAlpha " ,
178+ " preserveaspectratio " : " preserveAspectRatio " ,
179+ " primitiveunits " : " primitiveUnits " ,
180+ " refx " : " refX " ,
181+ " refy " : " refY " ,
182+ " repeatcount " : " repeatCount " ,
183+ " repeatdur " : " repeatDur " ,
184+ " requiredextensions " : " requiredExtensions " ,
185+ " requiredfeatures " : " requiredFeatures " ,
186+ " specularconstant " : " specularConstant " ,
187+ " specularexponent " : " specularExponent " ,
188+ " spreadmethod " : " spreadMethod " ,
189+ " startoffset " : " startOffset " ,
190+ " stddeviation " : " stdDeviation " ,
191+ " stitchtiles " : " stitchTiles " ,
192+ " surfacescale " : " surfaceScale " ,
193+ " systemlanguage " : " systemLanguage " ,
194+ " tablevalues " : " tableValues " ,
195+ " targetx " : " targetX " ,
196+ " targety " : " targetY " ,
197+ " textlength " : " textLength " ,
198+ " viewbox " : " viewBox " ,
199+ " viewtarget " : " viewTarget " ,
200+ " xchannelselector " : " xChannelSelector " ,
201+ " ychannelselector " : " yChannelSelector " ,
202+ " zoomandpan " : " zoomAndPan " ,
203203]
204204
205205/// MathML attribute case adjustments
206206let MATHML_ATTRIBUTE_ADJUSTMENTS : [ String : String ] = [
207- " definitionurl " : " definitionURL "
207+ " definitionurl " : " definitionURL " ,
208208]
209209
210210/// Foreign attribute adjustments (for namespaced attributes)
211211let FOREIGN_ATTRIBUTE_ADJUSTMENTS : [ String : String ] = [
212- " xlink:actuate " : " xlink actuate " ,
213- " xlink:arcrole " : " xlink arcrole " ,
214- " xlink:href " : " xlink href " ,
215- " xlink:role " : " xlink role " ,
216- " xlink:show " : " xlink show " ,
217- " xlink:title " : " xlink title " ,
218- " xlink:type " : " xlink type " ,
219- " xml:lang " : " xml lang " ,
220- " xml:space " : " xml space " ,
221- " xmlns " : " xmlns " ,
222- " xmlns:xlink " : " xmlns xlink " ,
212+ " xlink:actuate " : " xlink actuate " ,
213+ " xlink:arcrole " : " xlink arcrole " ,
214+ " xlink:href " : " xlink href " ,
215+ " xlink:role " : " xlink role " ,
216+ " xlink:show " : " xlink show " ,
217+ " xlink:title " : " xlink title " ,
218+ " xlink:type " : " xlink type " ,
219+ " xml:lang " : " xml lang " ,
220+ " xml:space " : " xml space " ,
221+ " xmlns " : " xmlns " ,
222+ " xmlns:xlink " : " xmlns xlink " ,
223223]
224224
225225/// ASCII whitespace characters
0 commit comments