kopia lustrzana https://github.com/shoelace-style/shoelace
remove code blocks from search results
rodzic
ca95822bba
commit
2376f75f1d
|
@ -90,7 +90,11 @@ console.log('Generating search index for documentation');
|
|||
.join(' ');
|
||||
const members = getMembers(content);
|
||||
|
||||
this.add({ id: index, t: title, h: headings, m: members, c: content });
|
||||
// Remove markdown code fields from search results. This seems to make search results a bit more accurate and
|
||||
// reduces search.json from ~679 KB to ~455 KB.
|
||||
const prunedContent = content.replace(/```(.*?)```/gs, '');
|
||||
|
||||
this.add({ id: index, t: title, h: headings, m: members, c: prunedContent });
|
||||
|
||||
map[index] = { title, url };
|
||||
});
|
||||
|
|
Ładowanie…
Reference in New Issue