Skip to content

解决针对''中含有的相同转义引号(即\')的错误识别,导致的包裹错误问题(双引号同理) #20

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/zh-wrap/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ const attrReg = /([@:a-zA-Z_][-a-zA-Z0-9_.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"'])*)")
// 前后非空白,这里必须是三个字符
const nonPreSubWhiteReg = /\S.+\S/
// 国际化字符串,被单引号或者双引号包裹,内容中文开头
const i18nStrReg = /"([^"{}\n]*[^\x00-\xff]+[^"{}\n]*)"|'([^'{}\n]*[^\x00-\xff]+[^'{}\n]*)'/g
const i18nStrReg = /"((?:[^"{}\n]|\\.)*[^\x00-\xff]+(?:[^"{}\n\\]|\\.)*)"|'((?:[^'{}\n]|\\.)*[^\x00-\xff]+(?:[^'{}\n\\]|\\.)*)'/g
// 国际化字符串,被反引号包裹,内容中文开头
const i18nStrRegForBacktick = /`([^`\n]*[^\x00-\xff]+[^`\n]*)`/g

Expand Down