notes search
This commit is contained in:
@@ -25,13 +25,7 @@ watch(
|
||||
)
|
||||
|
||||
export const setDefaultNotes = (defaultNotes: BaseNote[]) => {
|
||||
baseNotes.value = defaultNotes.map(
|
||||
(note): BaseNote => ({
|
||||
...note,
|
||||
created: new Date().getTime(),
|
||||
modified: new Date().getTime(),
|
||||
})
|
||||
)
|
||||
baseNotes.value = defaultNotes
|
||||
}
|
||||
|
||||
export const getNoteById = (noteId: string) => {
|
||||
@@ -41,7 +35,7 @@ export const getNoteById = (noteId: string) => {
|
||||
export const findNotes = (query: string): Note[] => {
|
||||
const removeMdFromText = (mdText: string): string => {
|
||||
const div = document.createElement('div')
|
||||
div.innerHTML = mdToHtml(mdText, 'c@')
|
||||
div.innerHTML = mdToHtml(mdText, 'c@', getNoteById)
|
||||
const textWithoutMd = div.textContent || div.innerText || ''
|
||||
return textWithoutMd
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user