Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: 样式(字符串)传入 puppeteer 以后被转义了 #24

Open
Seidko opened this issue May 23, 2023 · 1 comment · May be fixed by #26
Open

bug: 样式(字符串)传入 puppeteer 以后被转义了 #24

Seidko opened this issue May 23, 2023 · 1 comment · May be fixed by #26
Labels
bug Something isn't working

Comments

@Seidko
Copy link
Member

Seidko commented May 23, 2023

概述

如图:

image

样式中的 > 传入 puppeteer 以后被转义了,导致样式失效。

@Seidko Seidko changed the title bug: 样式传入 puppeteer 以后被转义了 bug: 样式(字符串)传入 puppeteer 以后被转义了 May 23, 2023
@shigma shigma added the bug Something isn't working label May 23, 2023
@Seidko
Copy link
Member Author

Seidko commented May 31, 2023

return strip ? this.attrs.content : Element.escape(this.attrs.content)

问题在这里,就算在 transform 函数里面处理了还是有可能会被转义。

我有两个想法:

  1. 这里加个 h.unescape
const content = h.unescape(children.map(transform).filter(Boolean).join(''))
  1. h.toString 函数添加一个 noEscape 参数,在为 true 的时候不做转义

@Seidko Seidko linked a pull request May 31, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants