From c70a18919b146bf70ad96e8abf5aa43b88b7dd37 Mon Sep 17 00:00:00 2001 From: Dominik Reh Date: Thu, 2 Feb 2023 18:56:07 +0100 Subject: [PATCH] Make tag regex work with more < configurations Will now allow completion of a < tag if the one directly after is also a < tag only separated by a space. (Happens often now that Loras are a thing and <>'s stay in the prompt with them) --- javascript/tagAutocomplete.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/javascript/tagAutocomplete.js b/javascript/tagAutocomplete.js index ee94115..cacb048 100644 --- a/javascript/tagAutocomplete.js +++ b/javascript/tagAutocomplete.js @@ -286,7 +286,9 @@ function isEnabled() { } const WEIGHT_REGEX = /[([]([^,()[\]:| ]+)(?::(?:\d+(?:\.\d+)?|\.\d+))?[)\]]/g; -const TAG_REGEX = /(<[^\t\n\r,>]+>?|[^\s,|<>]+|<)/g +const POINTY_REGEX = /<[^\s,<](?:[^\t\n\r,<>]*>|[^\t\n\r,> ]*)/g; +const NORMAL_TAG_REGEX = /[^\s,|<>]+|