html2canvas
html2canvas copied to clipboard
unexpected 'normal' characters in the generated image
there has unexpected 'normal' characters in the generated image
try 1.0.0-alpha.12
maybe useful
getComputedStyle方法是否被改写了。通过html2cavas 获取before/after 的节点内容出错。触发了token type 为20。default写入。// safari doesn't parse string tokens correctly because of lack of quotes
I also encountered this problem. I have try 1.4.1 and 1.3.4.
see it https://github.com/niklasvh/html2canvas/pull/2913
getComputedStyle方法是否被改写了。通过html2cavas 获取before/after 的节点内容出错。触发了token type 为20。default写入。// safari doesn't parse string tokens correctly because of lack of quotes
很奇怪, 确实是因为大量节点的 getComputedStyle.content 为 normal,但是不清楚为什么会这样。请问您有结论吗
getComputedStyle方法是否被改写了。通过html2cavas 获取before/after 的节点内容出错。触发了token type 为20。default写入。// safari doesn't parse string tokens correctly because of lack of quotes
很奇怪, 确实是因为大量节点的 getComputedStyle.content 为 normal,但是不清楚为什么会这样。请问您有结论吗
没有结论,调试时候发现有normal。将解析的content的值判断下normal问题就没了。。 chatgpt的答复:在使用 getComputedStyle 方法获取元素的样式属性时,content 属性的值为 "normal" 的情况包括:
对于非伪元素(non-pseudo-element):当没有应用伪元素的 content 属性或 ::before 或 ::after 伪元素选择器时,getComputedStyle 获取的 content 属性值将为 "normal"。这表示元素没有设置自定义的内容。
对于伪元素(pseudo-element):如果伪元素的 content 属性设置为 "normal",那么 getComputedStyle 获取到的伪元素的 content 属性值也将为 "normal"。这意味着伪元素将显示默认的内容,通常为空。
需要注意的是,getComputedStyle 返回的是计算后的样式值,而不是源代码中的初始值。因此,content 属性的值为 "normal" 并不意味着在 CSS 文件中没有设置该属性,而是表示没有自定义内容或使用默认内容。具体的样式规则和上下文将决定 content 属性的最终值。
获取元素的样式属性时,content 属性的值为 "normal"
请问在源码的哪里判断content的值为normal呢?也被这个问题困扰了
获取元素的样式属性时,content 属性的值为 "normal"
请问在源码的哪里判断content的值为normal呢?也被这个问题困扰了
https://github.com/niklasvh/html2canvas/pull/2913