mirror of
https://github.com/stack-auth/stack.git
synced 2026-07-20 21:29:36 +08:00
fix: escape llms docs titles
Co-Authored-By: Konstantin Wohlwend <n2d4xc@gmail.com>
This commit is contained in:
parent
d20adaeef5
commit
f6bdcd004d
@ -10,9 +10,13 @@ function formatPageListItem(page: {
|
||||
};
|
||||
url: string;
|
||||
}) {
|
||||
const title = page.data.title
|
||||
.replace(/\\/g, '\\\\')
|
||||
.replace(/[\[\]]/g, (match) => `\\${match}`)
|
||||
.replace(/\n+/g, ' ');
|
||||
const description = page.data.description?.trim();
|
||||
const notes = description ? `: ${description.replace(/\n+/g, ' ')}` : '';
|
||||
return `- [${page.data.title}](https://docs.hexclave.com${page.url}.md)${notes}`;
|
||||
return `- [${title}](https://docs.hexclave.com${page.url}.md)${notes}`;
|
||||
}
|
||||
|
||||
export async function GET() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user