@@ -10,7 +10,10 @@ module React
1010 main map mark menu menuitem meta meter nav noscript object ol optgroup option
1111 output p param picture pre progress q rp rt ruby s samp script section select
1212 small source span strong style sub summary sup table tbody td textarea tfoot th
13- thead time title tr track u ul var video wbr )
13+ thead time title tr track u ul var video wbr ) +
14+ # The SVG Tags
15+ %w( circle clipPath defs ellipse g line linearGradient mask path pattern polygon polyline
16+ radialGradient rect stop svg text tspan )
1417 ATTRIBUTES = %w( accept acceptCharset accessKey action allowFullScreen allowTransparency alt
1518 async autoComplete autoPlay cellPadding cellSpacing charSet checked classID
1619 className cols colSpan content contentEditable contextMenu controls coords
@@ -21,7 +24,38 @@ module React
2124 muted name noValidate open pattern placeholder poster preload radioGroup
2225 readOnly rel required role rows rowSpan sandbox scope scrolling seamless
2326 selected shape size sizes span spellCheck src srcDoc srcSet start step style
24- tabIndex target title type useMap value width wmode dangerouslySetInnerHTML )
27+ tabIndex target title type useMap value width wmode dangerouslySetInnerHTML ) +
28+ #SVG ATTRIBUTES
29+ %w( clipPath cx cy d dx dy fill fillOpacity fontFamily
30+ fontSize fx fy gradientTransform gradientUnits markerEnd
31+ markerMid markerStart offset opacity patternContentUnits
32+ patternUnits points preserveAspectRatio r rx ry spreadMethod
33+ stopColor stopOpacity stroke strokeDasharray strokeLinecap
34+ strokeOpacity strokeWidth textAnchor transform version
35+ viewBox x1 x2 x xlinkActuate xlinkArcrole xlinkHref xlinkRole
36+ xlinkShow xlinkTitle xlinkType xmlBase xmlLang xmlSpace y1 y2 y )
37+
38+ def self . html_tags? ( name )
39+ tags = HTML_TAGS
40+ `
41+ for(var i = 0; i < tags.length; i++){
42+ if(tags[i] === name)
43+ return true;
44+ }
45+ return false;
46+ `
47+ end
48+
49+ def self . html_attrs? ( name )
50+ attrs = ATTRIBUTES
51+ `
52+ for(var i = 0; i < attrs.length; i++){
53+ if(attrs[i] === name)
54+ return true;
55+ }
56+ return false;
57+ `
58+ end
2559
2660 def self . create_element ( type , properties = { } , &block )
2761 React ::API . create_element ( type , properties , &block )
0 commit comments