Skip to content

fix(component): 修复textarea高亮功能正则匹配bug#247

Open
chengjinyang0 wants to merge 1 commit intobaidu:masterfrom
chengjinyang0:fix-textarea-highlight-rule
Open

fix(component): 修复textarea高亮功能正则匹配bug#247
chengjinyang0 wants to merge 1 commit intobaidu:masterfrom
chengjinyang0:fix-textarea-highlight-rule

Conversation

@chengjinyang0
Copy link
Copy Markdown

@chengjinyang0 chengjinyang0 commented Aug 15, 2022

textarea高亮功能,传入规则匹配时,会把匹配到的匹配项作为正则处理。
匹配项中包含[]等正则特殊含义字符时,会导致高亮替换不符合预期。
例:使用.*匹配到[127.0.0.1],会匹配[]中的9个字符,
最终替换结果变为: [[127.0.0.1][127.0.0.1][127.0.0.1][127.0.0.1][127.0.0.1][127.0.0.1][127.0.0.1][127.0.0.1][127.0.0.1]]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant