contexted link styling
This commit is contained in:
@@ -4,8 +4,6 @@ import { mdToHtml } from '@/utils/markdown'
|
||||
import { getAllMatches } from '@/utils/helpers'
|
||||
import shortid from 'shortid'
|
||||
|
||||
const contextedPrefix = 'c@'
|
||||
|
||||
const baseNotes = reactive<{ [noteId: string]: BaseNote }>({})
|
||||
|
||||
export const notes = computed<Note[]>(() => {
|
||||
@@ -40,10 +38,14 @@ export const getNoteById = (noteId: string) => {
|
||||
return notes.value.find((note) => note.id === noteId)
|
||||
}
|
||||
|
||||
export const getNoteByTitle = (title: string) => {
|
||||
return notes.value.find((note) => note.title === title)
|
||||
}
|
||||
|
||||
export const findNotes = (query: string): Note[] => {
|
||||
const removeMdFromText = (mdText: string): string => {
|
||||
const div = document.createElement('div')
|
||||
div.innerHTML = mdToHtml(mdText, contextedPrefix, getNoteById)
|
||||
div.innerHTML = mdToHtml(mdText)
|
||||
const textWithoutMd = div.textContent || div.innerText || ''
|
||||
return textWithoutMd
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user