WIP better matching

This commit is contained in:
Simon Cambier
2022-04-16 21:11:57 +02:00
parent 832e782ba8
commit 43b617e2af
7 changed files with 74 additions and 47 deletions

View File

@@ -1,3 +1,5 @@
import type { SearchResult } from 'minisearch'
// Matches a wikiling that begins a string
export const regexWikilink = /^!?\[\[(?<name>.+?)(\|(?<alias>.+?))?\]\]/
export const regexLineSplit = /\r?\n|\r|((\.|\?|!)( |\r?\n|\r))/g
@@ -27,6 +29,7 @@ export const isSearchMatch = (o: { index?: number }): o is SearchMatch => {
}
export type ResultNote = {
searchResult: SearchResult
path: string
basename: string
content: string