Skip to content

Commit

Permalink
Account for edge case where user deleted leading separator.
Browse files Browse the repository at this point in the history
  • Loading branch information
zixaphir committed Aug 31, 2023
1 parent 41196cc commit 78c1a74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion javascript/extraNetworks.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ function tryToRemoveExtraNetworkFromPrompt(textarea, text) {
var extraTextAfterNet = m[2];
var partToSearch = m[1];
var foundAtPosition = -1;
var escapedSeparator = reEscape(opts.extra_networks_add_text_separator);
var escapedSeparator = `(?:${reEscape(opts.extra_networks_add_text_separator)})?`;
var re = new RegExp(escapedSeparator + re_extranet_str, 'g');
newTextareaText = textarea.value.replaceAll(re, function(found, net, pos) {
m = found.match(re_extranet);
Expand Down

0 comments on commit 78c1a74

Please sign in to comment.