diff --git a/examples/markdownit/nuxt.config.js b/examples/markdownit/nuxt.config.js index 5660fb118d..a1d31f09bd 100644 --- a/examples/markdownit/nuxt.config.js +++ b/examples/markdownit/nuxt.config.js @@ -1,16 +1,8 @@ module.exports = { modules: [ '@nuxtjs/markdownit' + ], + plugins: [ + '~/plugins/md-it' ] - // [optional] markdownit options - // See https://github.com/markdown-it/markdown-it - // markdownit: { - // preset: 'default', - // linkify: true, - // breaks: true, - // use: [ - // 'markdown-it-container', - // 'markdown-it-attrs' - // ] - // } } diff --git a/examples/markdownit/package.json b/examples/markdownit/package.json index 76056fdcbb..bdbe75cd3b 100644 --- a/examples/markdownit/package.json +++ b/examples/markdownit/package.json @@ -10,5 +10,8 @@ "dev": "nuxt", "build": "nuxt build", "start": "nuxt start" + }, + "devDependencies": { + "jstransformer-markdown-it": "^2.0.0" } } diff --git a/examples/markdownit/pages/pug.vue b/examples/markdownit/pages/pug.vue index e15883bc67..fed7edda72 100644 --- a/examples/markdownit/pages/pug.vue +++ b/examples/markdownit/pages/pug.vue @@ -1,8 +1,10 @@ @@ -11,7 +13,7 @@ export default { data() { return { - model: 'I am pug' + model: '## Title h2\n### title h3\n\nLong text Long text Long text Long text Long text Long text Long text Long text Long text \n\n* gimme a list item\n* and one more yeehaw' } } } diff --git a/examples/markdownit/plugins/md-it.js b/examples/markdownit/plugins/md-it.js new file mode 100644 index 0000000000..3080f20046 --- /dev/null +++ b/examples/markdownit/plugins/md-it.js @@ -0,0 +1,5 @@ +import MarkdownIt from 'markdown-it' + +export default ({ app }, inject) => { + inject('md', new MarkdownIt()) +}