Skip to content

Commit

Permalink
chore(site): strip error and file annotations from code blocks for se…
Browse files Browse the repository at this point in the history
…arch (#9971)
  • Loading branch information
gtm-nayan authored May 18, 2023
1 parent 29989ed commit 35eafa9
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ function plaintext(markdown) {
const inline = (text) => text;

return transform(markdown, {
code: (source) => source.split('// ---cut---\n').pop(),
code: (source) =>
source
.split('// ---cut---\n')
.pop()
.replace(/^\/\/((\/ file:)|( @errors:))[\s\S]*/gm, ''),
blockquote: block,
html: () => '\n',
heading: (text) => `${text}\n`,
Expand Down

0 comments on commit 35eafa9

Please sign in to comment.