@@ -12,7 +12,7 @@ Current version indicated by LITEVER below.
1212-->
1313
1414<script id="init-config">
15- const LITEVER = 269 ;
15+ const LITEVER = 270 ;
1616 const urlParams = new URLSearchParams(window.location.search);
1717 var localflag = urlParams.get('local'); //this will be replaced automatically in embedded kcpp
1818 const STORAGE_PREFIX = (localflag?"e_":"")+"kaihordewebui_";
@@ -3995,9 +3995,9 @@ Current version indicated by LITEVER below.
39953995
39963996 try {
39973997 // Test if lookahead is supported, enhance italics regex if so
3998- let improved_italics = new RegExp("\\*(?!\\s)(. +?)(?<!\\s)\\*","g");
3998+ let improved_italics = new RegExp("\\*(?!\\s)([\\s\\S] +?)(?<!\\s)\\*","g");
39993999 italics_regex = improved_italics;
4000- let improved_bold = new RegExp("\\*\\*(?!\\s)(. +?)(?<!\\s)\\*\\*","g");
4000+ let improved_bold = new RegExp("\\*\\*(?!\\s)([\\s\\S] +?)(?<!\\s)\\*\\*","g");
40014001 bold_regex = improved_bold;
40024002 } catch (e) {
40034003 console.log('Lookaheads are not supported in this environment.');
@@ -4524,7 +4524,7 @@ Current version indicated by LITEVER below.
45244524 {
45254525 return "";
45264526 }
4527- return `${localsettings.start_thinking_tag}([\\s\\S]+ ?)${localsettings.stop_thinking_tag}`;
4527+ return `${localsettings.start_thinking_tag}([\\s\\S]* ?)${localsettings.stop_thinking_tag}`;
45284528 }
45294529
45304530 function remove_all_instruct_tags(text)
@@ -6121,9 +6121,9 @@ Current version indicated by LITEVER below.
61216121 .replace(/<\/li><\/ul>\n\s*?\n<ul><li>/gm, "</li>\n<li>")
61226122 .replace(/<\/li><\/ul>\s*?<ul><li>/gm, "</li><li>")
61236123
6124- .replace(/\*\*\*([^\s*]. *?[^\\])\*\*\*/gm, "<b><em>$1</em></b>")
6125- .replace(/\*\*([^\s*]. *?[^\\])\*\*/gm, "<b>$1</b>")
6126- .replace(/\*([^\s*]. *?[^\\])\*/gm, "<em>$1</em>")
6124+ .replace(/\*\*\*([^\s*][\s\S] *?[^\\])\*\*\*/gm, "<b><em>$1</em></b>")
6125+ .replace(/\*\*([^\s*][\s\S] *?[^\\])\*\*/gm, "<b>$1</b>")
6126+ .replace(/\*([^\s*][\s\S] *?[^\\])\*/gm, "<em>$1</em>")
61276127 .replace(/___(\w.*?[^\\])___/gm, "<b><em>$1</em></b>")
61286128 .replace(/__(\w.*?[^\\])__/gm, "<u>$1</u>")
61296129 .replace(/~~(\w.*?)~~/gm, "<del>$1</del>")
@@ -14522,7 +14522,7 @@ Current version indicated by LITEVER below.
1452214522 inputtxt = inputtxt.replace(/%ExpandBtn%(?:\n{0,2})?/g, function (m) {
1452314523 let curr = matches[matchiter];
1452414524 let expandedhtml = `<span><button type="button" title="Show Thoughts" class="btn btn-primary" style="font-size:12px;padding:2px 2px;" onclick="toggle_hide_thinking(this)">Show Thoughts (${curr.length} characters)</button><span class="color_lightgreen hidden"><br>${escape_html(curr)}</span><br></span>`;
14525- if(!curr || curr.trim()=="" || curr.trim()=="/nothink")
14525+ if(!curr || curr.trim()=="" || curr.trim()=="/nothink" || curr.trim()==`${localsettings.start_thinking_tag}${localsettings.stop_thinking_tag}` )
1452614526 {
1452714527 expandedhtml = `<span><button type="button" title="No Thoughts" class="btn btn-primary" style="font-size:12px;padding:2px 2px;" onclick="">No Thoughts</button><br></span>`;
1452814528 }
0 commit comments