Skip to content

支持tag中的内容出现* [] () - 用来处理可能会出现的场景 #19

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 2 commits 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 @@ -231,7 +231,7 @@ const templateReg = new RegExp("<template>([\\s\\S]+)<\\/template>", "i")
// 处理script
const scriptReg = /<script(?:\s*|\s+.+?)>([\s\S]+)<\/script>/i
// tag的内容正则匹配
const TagContentReg = new RegExp('>((?:[^\x00-\xff]|\w|[:0-9{}.A-Za-z/\\s])+)<', 'g')
const TagContentReg = new RegExp('>((?:[^\x00-\xff]|\w|[:0-9{}()\\[\\]*-.A-Za-z/\\s])+)<', 'g')
// html start tag匹配正则
const startTagReg = new RegExp(/<(?:[-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:@][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(?:\/?)>/, 'g')
// 三目预算法正则,简易版本
Expand Down