_qstags: Let's try a simpler substitution for speed
This commit is contained in:
parent
d3ccb64a73
commit
81b22db011
18
qsgen2
18
qsgen2
@ -1284,13 +1284,17 @@ function _qstags() {
|
|||||||
"#LT" "<" "#GT" ">" "#NUM" "#"
|
"#LT" "<" "#GT" ">" "#NUM" "#"
|
||||||
)
|
)
|
||||||
|
|
||||||
for qstag html (${(kv)qstags})
|
#for qstag html (${(kv)qstags})
|
||||||
do
|
# do
|
||||||
# Escape tag for regex use
|
# # Escape tag for regex use
|
||||||
local escapedTag=$(printf '%s' "$qstag" | sed 's/[].\[^$*]/\\&/g')
|
# local escapedTag=$(printf '%s' "$qstag" | sed 's/[].\[^$*]/\\&/g')
|
||||||
if [[ "$content" =~ "$escapedTag" ]]; then
|
# if [[ "$content" =~ "$escapedTag" ]]; then
|
||||||
content=${content//($qstag)/$html}
|
# content=${content//($qstag)/$html}
|
||||||
fi
|
# fi
|
||||||
|
#done
|
||||||
|
for qstag html (${(kv)qstags}); do
|
||||||
|
# Direct replacement without regex check
|
||||||
|
content=${content//${qstag}/${html}}
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "${content}"
|
echo "${content}"
|
||||||
|
Loading…
Reference in New Issue
Block a user