koishi-plugin-chatluna-character 0.0.77 → 0.0.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.cjs CHANGED
@@ -264,7 +264,7 @@ function splitSentence(text) {
264
264
  }
265
265
  __name(splitSentence, "splitSentence");
266
266
  function matchAt(str) {
267
- const atRegex = /<at[^>]*>(.*?)<\/at>/g;
267
+ const atRegex = /<at[^>]*>(.*?)<\/at>/;
268
268
  return [...str.matchAll(atRegex)].map((item) => {
269
269
  return {
270
270
  at: item[1],
@@ -275,7 +275,7 @@ function matchAt(str) {
275
275
  }
276
276
  __name(matchAt, "matchAt");
277
277
  function matchPre(str) {
278
- const preRegex = /<pre[^>]*>(.*?)<\/pre>/g;
278
+ const preRegex = /<pre>(.*?)<\/pre>/gs;
279
279
  return [...str.matchAll(preRegex)].map((item) => {
280
280
  return {
281
281
  pre: item[1],
package/lib/index.d.ts CHANGED
@@ -43,6 +43,10 @@ export interface GroupInfo {
43
43
  }
44
44
  export function isEmoticonStatement(text: string, elements: Element[]): 'emoji' | 'text' | 'span';
45
45
  export function isOnlyPunctuation(text: string): boolean;
46
+ export function processTextMatches(rawMessage: string, useAt?: boolean): {
47
+ currentElements: h[];
48
+ parsedMessage: string;
49
+ };
46
50
  export function parseResponse(response: string, useAt?: boolean): {
47
51
  elements: h[][];
48
52
  rawMessage: string;
package/lib/index.mjs CHANGED
@@ -232,7 +232,7 @@ function splitSentence(text) {
232
232
  }
233
233
  __name(splitSentence, "splitSentence");
234
234
  function matchAt(str) {
235
- const atRegex = /<at[^>]*>(.*?)<\/at>/g;
235
+ const atRegex = /<at[^>]*>(.*?)<\/at>/;
236
236
  return [...str.matchAll(atRegex)].map((item) => {
237
237
  return {
238
238
  at: item[1],
@@ -243,7 +243,7 @@ function matchAt(str) {
243
243
  }
244
244
  __name(matchAt, "matchAt");
245
245
  function matchPre(str) {
246
- const preRegex = /<pre[^>]*>(.*?)<\/pre>/g;
246
+ const preRegex = /<pre>(.*?)<\/pre>/gs;
247
247
  return [...str.matchAll(preRegex)].map((item) => {
248
248
  return {
249
249
  pre: item[1],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-chatluna-character",
3
3
  "description": "Let the large language model play a role, disguise as a group friend",
4
- "version": "0.0.77",
4
+ "version": "0.0.78",
5
5
  "type": "module",
6
6
  "main": "lib/index.cjs",
7
7
  "module": "lib/index.mjs",