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 +2 -2
- package/lib/index.d.ts +4 -0
- package/lib/index.mjs +2 -2
- package/package.json +1 -1
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
|
|
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
|
|
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
|
|
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
|
|
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