|
|
@@ -8,7 +8,7 @@ export const namespaceMap = {
|
|
|
math: 'http://www.w3.org/1998/Math/MathML'
|
|
|
}
|
|
|
|
|
|
-export const isReservedTag = makeMap(
|
|
|
+export const isHTMLTag = makeMap(
|
|
|
'html,body,base,head,link,meta,style,title,' +
|
|
|
'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
|
|
|
'div,dd,dl,dt,figcaption,figure,hr,img,li,main,ol,p,pre,ul,' +
|
|
|
@@ -46,13 +46,19 @@ export const isNonPhrasingTag = makeMap(
|
|
|
true
|
|
|
)
|
|
|
|
|
|
-// this map covers namespace elements that can appear as template root nodes
|
|
|
-const isSVG = makeMap(
|
|
|
- 'svg,g,defs,symbol,use,image,text,circle,ellipse,' +
|
|
|
- 'line,path,polygon,polyline,rect',
|
|
|
+// this map is intentionally selective, only covering SVG elements that may
|
|
|
+// contain child elements.
|
|
|
+export const isSVG = makeMap(
|
|
|
+ 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font,' +
|
|
|
+ 'font-face,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
|
|
|
+ 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',
|
|
|
true
|
|
|
)
|
|
|
|
|
|
+export const isReservedTag = (tag: string): ?boolean => {
|
|
|
+ return isHTMLTag(tag) || isSVG(tag)
|
|
|
+}
|
|
|
+
|
|
|
export function getTagNamespace (tag: string): ?string {
|
|
|
if (isSVG(tag)) {
|
|
|
return 'svg'
|