bubkoo / html-to-image

✂️ Generates an image from a DOM node using HTML5 canvas and SVG.
MIT License
5.39k stars 503 forks source link

svg image 的xlink:href 资源跨域 #418

Open YvesChen opened 11 months ago

YvesChen commented 11 months ago

svg image 的xlink:href 资源跨域

image

暂时的解决方法,是过滤掉当前资源 大家如果遇到相同的问题快速解决方法如下:

filter:(HTMLElement)=>{
  let _status = true;
  try{
    if(typeof HTMLElement == 'object' && HTMLElement.getAttribute('xlink:href') && HTMLElement.getAttribute('xlink:href').includes('user/gallery/')){
      _status = false;
    }
  }catch(error){}
  if(_status){
    return HTMLElement;
  }
}
vivcat[bot] commented 11 months ago

👋 @YvesChen

Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. To help make it easier for us to investigate your issue, please follow the contributing guidelines.

We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.