mirror of
https://gitee.com/docsifyjs/docsify.git
synced 2024-11-30 02:58:37 +08:00
Fix getAndRemoveConfig regex (#708)
* Fix getAndRemoveConfig regex Update getAndRemoveConfig regular expression for prevent cases, when header has name like "foo::bar::baz". * Fix wrong regexp * Fix regex Ignore `:foo` cases
This commit is contained in:
parent
28beff80f7
commit
6ac7bace21
@ -19,7 +19,7 @@ export function getAndRemoveConfig(str = '') {
|
||||
str = str
|
||||
.replace(/^'/, '')
|
||||
.replace(/'$/, '')
|
||||
.replace(/:([\w-]+)=?([\w-]+)?/g, (m, key, value) => {
|
||||
.replace(/(?:^|\s):([\w-]+)=?([\w-]+)?/g, (m, key, value) => {
|
||||
config[key] = (value && value.replace(/"/g, '')) || true
|
||||
return ''
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user