为什么ngSanitize从html文本中移除具有相对路径的图像源(如<img src="/img/lol.jpg> ),而不像<img src="http://site.com/img/lol.jpg">那样接触具有绝对路径的图像
发布于 2014-10-03 11:36:59
image URL whitelist正则表达式为/^\s*((https?|ftp|file|blob):|data:image\/)/,它与相对URL不匹配。
您可以根据the compile provider docs覆盖白名单。
app.config(function($compileProvider) {
$compileProvider.imgSrcSanitizationWhitelist(<your regexp here>);
});https://stackoverflow.com/questions/15141337
复制相似问题