(notes) add routing between notes

This commit is contained in:
2021-03-13 22:11:58 +01:00
parent 2bb43ac961
commit 8fad931dfd
12 changed files with 343 additions and 65 deletions

View File

@@ -0,0 +1,20 @@
import MarkdownIt from 'markdown-it'
import markdownItClass from '@toycode/markdown-it-class'
// import sanitizeHtml from 'sanitize-html'
const md = new MarkdownIt().use(markdownItClass, {
h1: ['title', 'is-1'],
h2: ['subtitle', 'is-2'],
h3: ['subtitle', 'is-3'],
h4: ['subtitle', 'is-4'],
h5: ['subtitle', 'is-5'],
h6: ['subtitle', 'is-6'],
table: ['table', 'is-striped', 'is-hoverable', 'is-fullwidth']
})
export const useMarkdown = () => {
return {
render: (content: string) =>
md.render(decodeURIComponent(escape(atob(content))))
}
}