Make replacementPatterns do global replace
From readme:
replacementPatterns: An array of objects holding regular expressions which are replaced in a link with their corresponding replacement string. This behavior allows (for example) to adapt to certain platform conventions hosting the Markdown. The special replacement {{BASEURL}} can be used to dynamically link to the current working directory (for example that / points to the root of your current working directory).
I am checking gitlab wiki repository where spaces are encoded as %20 when saving, but in filenames they're -. tried such config, but it replaced only first occurrence of %20:
{
"replacementPatterns": [
{
"pattern": "$",
"replacement": ".md"
},
{
"pattern": "%20",
"replacement": "-"
}
]
}
please add /g like flag:
/%20/g
workaround: add same pattern as many times until no more matches are left. in my case:
{
"replacementPatterns": [
{
"pattern": "$",
"replacement": ".md"
},
{
"pattern": "%20",
"replacement": "-"
},
{
"pattern": "%20",
"replacement": "-"
},
{
"pattern": "%20",
"replacement": "-"
},
{
"pattern": "%20",
"replacement": "-"
},
{
"pattern": "%20",
"replacement": "-"
}
]
}
It could be added with an optional "global": true to avoid breaking changes?