diff --git a/README.md b/README.md index 2963762..add3791 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ Check package.json for commands, I can't be bothered. ### Changelog +- 1.3: Mooth found a bug, fixed it. - 1.2: Fix for Janitor having changed their prompt system - 1.1: Fix for R1 handling change, blank user persona bug - 1.0: Yup. diff --git a/src/app/api/proxy/route.ts b/src/app/api/proxy/route.ts index f7fe105..d22c037 100644 --- a/src/app/api/proxy/route.ts +++ b/src/app/api/proxy/route.ts @@ -46,13 +46,19 @@ function findTagsBetween(content: string, startMarker: string, endMarker: string if (endIdx === -1) return []; const section = content.slice(startIdx + startMarker.length + 2, endIdx); - const tagRegex = /<([^/>]+)>([^<]+)<\/\1>/g; - const matches = Array.from(section.matchAll(tagRegex)); + const matches: PersonaMatch[] = []; - return matches.map(match => ({ - tag: match[1], - content: match[2].trim() - })); + const tagPattern = /<([^/>][^>]*)>([^]*?)<\/\1>/g; + let match; + + while ((match = tagPattern.exec(section)) !== null) { + matches.push({ + tag: match[1], + content: match[2].trim() + }); + } + + return matches; } function extractBetweenTags(content: string, tag: string): string { diff --git a/src/app/page.tsx b/src/app/page.tsx index 68e4b28..43d397d 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -187,9 +187,9 @@ export default function Home() {
-

Sucker v1.2

+

Sucker v1.3

- If it's any consolation, I hate making these changes too. + I still hate making these changes, but Mooth found a bug so I fixed it.