diff --git a/javascript/ext_loras.js b/javascript/ext_loras.js index 44ad8f0..9a94b75 100644 --- a/javascript/ext_loras.js +++ b/javascript/ext_loras.js @@ -18,7 +18,7 @@ class LoraParser extends BaseTagParser { tempResults.forEach(t => { const text = t[0].trim(); let lastDot = text.lastIndexOf(".") > -1 ? text.lastIndexOf(".") : text.length; - let lastSlash = text.lastIndexOf("/") > -1 ? text.lastIndexOf("/") : 0; + let lastSlash = text.lastIndexOf("/") > -1 ? text.lastIndexOf("/") : -1; let name = text.substring(lastSlash + 1, lastDot); let result = new AutocompleteResult(name, ResultType.lora) diff --git a/javascript/ext_lycos.js b/javascript/ext_lycos.js index 9fd8ac1..dd1b439 100644 --- a/javascript/ext_lycos.js +++ b/javascript/ext_lycos.js @@ -18,7 +18,7 @@ class LycoParser extends BaseTagParser { tempResults.forEach(t => { const text = t[0].trim(); let lastDot = text.lastIndexOf(".") > -1 ? text.lastIndexOf(".") : text.length; - let lastSlash = text.lastIndexOf("/") > -1 ? text.lastIndexOf("/") : 0; + let lastSlash = text.lastIndexOf("/") > -1 ? text.lastIndexOf("/") : -1; let name = text.substring(lastSlash + 1, lastDot); let result = new AutocompleteResult(name, ResultType.lyco)