share page fix ai text

This commit is contained in:
Jay V
2025-06-09 14:19:26 -05:00
parent d4f8fd867a
commit c091cbb624
3 changed files with 14 additions and 16 deletions

View File

@@ -150,6 +150,12 @@ function flattenToolArgs(obj: any, prefix: string = ""): Array<[string, any]> {
return entries
}
function stripEnclosingTag(text: string): string {
const wrappedRe = /^\s*<([A-Za-z]\w*)>\s*([\s\S]*?)\s*<\/\1>\s*$/
const match = text.match(wrappedRe)
return match ? match[2] : text
}
function getStatusText(status: [Status, string?]): string {
switch (status[0]) {
case "connected":
@@ -745,8 +751,8 @@ export default function Share(props: {
</div>
<div data-section="content">
<MarkdownPart
text={part().text}
expand={isLastPart()}
text={stripEnclosingTag(part().text)}
/>
</div>
</div>