Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

feat(ngSanitize): accept SVG elements and attributes #9751

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
feat(ngSanitize): accept SVG elements and attributes
SVG elements and attributes are now accepted and sanitized by ngSanitize.

Closes #9578
  • Loading branch information
Christian Liebel committed Oct 22, 2014
commit ceec379f344636303997ef2266f560ea0df3c927
4 changes: 2 additions & 2 deletions src/ngSanitize/sanitize.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ var inlineElements = angular.extend({}, optionalEndTagInlineElements, makeMap("a

// SVG Elements
// https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Elements
var svgElements = makeMap("a,animate,animateColor,animateMotion,animateTransform,circle,defs," +
var svgElements = makeMap("animate,animateColor,animateMotion,animateTransform,circle,defs," +
"desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient," +
"line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,set," +
"stop,svg,switch,text,title,tspan,use");
Expand All @@ -216,7 +216,7 @@ var uriAttrs = makeMap("background,cite,href,longdesc,src,usemap,xmlns:href");
var htmlAttrs = makeMap('abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,'+
'color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,'+
'ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,'+
'scope,scrolling,shape,size,span,start,summary,svg,target,title,type,'+
'scope,scrolling,shape,size,span,start,summary,target,title,type,'+
'valign,value,vspace,width');

// SVG attributes (without "id" and "name" attributes)
Expand Down