mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 09:38:06 +02:00
Use replaceAll
in the recoverJsURL
helper function
We can just do direct replacement when building the regular expression, rather than splitting the string into an Array and then re-joining it.
This commit is contained in:
parent
c706c6c34f
commit
035a273d30
1 changed files with 1 additions and 1 deletions
|
@ -515,7 +515,7 @@ function recoverJsURL(str) {
|
|||
const URL_OPEN_METHODS = ["app.launchURL", "window.open", "xfa.host.gotoURL"];
|
||||
const regex = new RegExp(
|
||||
"^\\s*(" +
|
||||
URL_OPEN_METHODS.join("|").split(".").join("\\.") +
|
||||
URL_OPEN_METHODS.join("|").replaceAll(".", "\\.") +
|
||||
")\\((?:'|\")([^'\"]*)(?:'|\")(?:,\\s*(\\w+)\\)|\\))",
|
||||
"i"
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue