Skip to content

Commit 35eafa9

Browse files
authored
chore(site): strip error and file annotations from code blocks for search (#9971)
1 parent 29989ed commit 35eafa9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sites/kit.svelte.dev/src/routes/content.json/content.server.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,11 @@ function plaintext(markdown) {
8888
const inline = (text) => text;
8989

9090
return transform(markdown, {
91-
code: (source) => source.split('// ---cut---\n').pop(),
91+
code: (source) =>
92+
source
93+
.split('// ---cut---\n')
94+
.pop()
95+
.replace(/^\/\/((\/ file:)|( @errors:))[\s\S]*/gm, ''),
9296
blockquote: block,
9397
html: () => '\n',
9498
heading: (text) => `${text}\n`,

0 commit comments

Comments
 (0)