Coder Social home page Coder Social logo

Comments (8)

lujihong avatar lujihong commented on June 17, 2024 1

我在MAC 端测试没问题,在安卓端测试也没问题,在IOS 16.5.1 微信8.0.39端测试就不行

from modern-screenshot.

lujihong avatar lujihong commented on June 17, 2024

修改以下代码就没问题了:
function de(e) {
const t = new XMLSerializer().serializeToString(e)
.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F\uFFFE\uFFFF]/ug, ""); //方法一:去掉\uD800-\uDFFF
//.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/ug, ""); //方法二:注释掉全部
return data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)};
}

from modern-screenshot.

qq15725 avatar qq15725 commented on June 17, 2024

这段代码是过滤掉 xml 中 null 控制符的,估计是误伤两个 unicode 组成的 emoji 了,可以提供下异常的 emoji

from modern-screenshot.

lujihong avatar lujihong commented on June 17, 2024

😊😘 我随便测试了几个emoji都有问题

from modern-screenshot.

qq15725 avatar qq15725 commented on June 17, 2024
image

https://modern-screenshot.vercel.app/

这两个 emoji 我浏览器是没问题,看是环境问题还是其他 emoji ,最好是把整段有问题的提供下

from modern-screenshot.

qq15725 avatar qq15725 commented on June 17, 2024

v4.4.27 支持了只启用部分特性

domToPng({
  features: {
    // 不启用移除控制符
    removeControlCharacter: false,
  }
})

from modern-screenshot.

jeremiecarlson avatar jeremiecarlson commented on June 17, 2024

I have the same issue - iOS only - no issue on desktop Safari
Using domToBlob in my use case.
Setting removeControlCharacter to true/false makes no difference to the error

from modern-screenshot.

jeremiecarlson avatar jeremiecarlson commented on June 17, 2024

Using the vercel demo app you can reproduce:
Running iPhone 15 simulator on iOS 17.2

Screenshot 2023-12-13 at 1 30 56 PM

from modern-screenshot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.