@@ -43,15 +43,15 @@ const ACCEPTED_SVG_ELEMENTS = [
4343
4444// Attributes from SVG elements that are mapped directly.
4545const SVG_ATTS = [ "viewBox" , "width" , "height" ] ;
46- const G_ATTS = [ "id" ] ;
46+ const G_ATTS = [ "id" , "fill" , "textAnchor" , "fontFamily" ] ;
4747
4848const CIRCLE_ATTS = [ "cx" , "cy" , "r" ] ;
4949const PATH_ATTS = [ "d" ] ;
5050const RECT_ATTS = [ "width" , "height" ] ;
5151const LINE_ATTS = [ "x1" , "y1" , "x2" , "y2" ] ;
5252const LINEARG_ATTS = LINE_ATTS . concat ( [ "id" , "gradientUnits" ] ) ;
5353const RADIALG_ATTS = CIRCLE_ATTS . concat ( [ "id" , "gradientUnits" ] ) ;
54- const STOP_ATTS = [ "offset" ] ;
54+ const STOP_ATTS = [ "offset" , "stopOpacity" , "stopColor" ] ;
5555const ELLIPSE_ATTS = [ "cx" , "cy" , "rx" , "ry" ] ;
5656
5757const TEXT_ATTS = [ "fontFamily" , "fontSize" , "fontWeight" ] ;
@@ -76,7 +76,9 @@ const COMMON_ATTS = [
7676 "scale" ,
7777 "origin" ,
7878 "originX" ,
79- "originY"
79+ "originY" ,
80+ "stopOpacity" ,
81+ "stopColor"
8082] ;
8183
8284let ind = 0 ;
@@ -164,7 +166,7 @@ class SvgUri extends Component {
164166 trimElementChilden ( children ) {
165167 for ( child of children ) {
166168 if ( typeof child === "string" ) {
167- if ( child . trim . length === 0 )
169+ if ( child . trim ( ) . length === 0 )
168170 children . splice ( children . indexOf ( child ) , 1 ) ;
169171 }
170172 }
@@ -270,9 +272,7 @@ class SvgUri extends Component {
270272 ) ;
271273 case "text" :
272274 componentAtts = this . obtainComponentAtts ( node , TEXT_ATTS ) ;
273- if ( componentAtts . y ) {
274- componentAtts . y = fixYPosition ( componentAtts . y , node ) ;
275- }
275+
276276 return (
277277 < Text key = { i } { ...componentAtts } >
278278 { childs }
0 commit comments