We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d6a0cb1 commit 79e7f9fCopy full SHA for 79e7f9f
src/util/discordDocs.ts
@@ -127,11 +127,15 @@ export function parseSections(content: string): ParsedSection[] {
127
return res;
128
}
129
130
+function formatAnchor(text: string) {
131
+ return `#${text.toLowerCase().replaceAll(' ', '-').replaceAll(/[:'.]/gi, '')}`;
132
+}
133
+
134
export function findRelevantDocsSection(query: string, docsMd: string, defaultFirst = false) {
135
const sections = parseSections(docsMd);
136
137
for (const section of sections) {
- const anchor = `#${section.headline.toLowerCase().replaceAll(' ', '-').replaceAll(':', '')}`;
138
+ const anchor = formatAnchor(section.headline);
139
140
if (anchor === query) {
141
return section;
0 commit comments