(youtube) imbedded videos

This commit is contained in:
2021-04-06 00:19:49 +02:00
parent 49f1460749
commit 1286872aa9

View File

@@ -1,10 +1,13 @@
import MarkdownIt from 'markdown-it' import MarkdownIt from 'markdown-it'
import markdownItClass from '@toycode/markdown-it-class' import markdownItClass from '@toycode/markdown-it-class'
import blockEmbedPlugin from 'markdown-it-block-embed'
import { NOTE_WIDTH } from '@/constants/note-width'
const md = new MarkdownIt({ const md = new MarkdownIt({
typographer: true, typographer: true,
quotes: ['«\xA0', '\xA0»', '\xA0', '\xA0'] quotes: ['«\xA0', '\xA0»', '\xA0', '\xA0']
}).use(markdownItClass, { })
.use(markdownItClass, {
h1: ['title', 'is-2'], h1: ['title', 'is-2'],
h2: ['title', 'is-3'], h2: ['title', 'is-3'],
h3: ['title', 'is-4'], h3: ['title', 'is-4'],
@@ -12,7 +15,12 @@ const md = new MarkdownIt({
h5: ['title', 'is-6'], h5: ['title', 'is-6'],
h6: ['title', 'is-6'], h6: ['title', 'is-6'],
table: ['table', 'is-striped', 'is-hoverable'] table: ['table', 'is-striped', 'is-hoverable']
}) })
.use(blockEmbedPlugin, {
youtube: {
width: NOTE_WIDTH - 80
}
})
export const useMarkdown = () => { export const useMarkdown = () => {
return { return {