mirror of
https://github.com/wahyd4/vuepress.git
synced 2026-08-27 14:15:52 +10:00
15 lines
430 B
JavaScript
15 lines
430 B
JavaScript
const { getOptions } = require('loader-utils')
|
|
const frontmatter = require('yaml-front-matter')
|
|
|
|
module.exports = function (src) {
|
|
const { markdown } = getOptions(this)
|
|
const content = frontmatter.loadFront(src).__content
|
|
const { html, hoistedTags } = markdown.renderWithHoisting(content)
|
|
return (
|
|
`<template>\n` +
|
|
`<div class="markdown">${html}</div>\n` +
|
|
`</template>\n` +
|
|
hoistedTags.join('\n')
|
|
)
|
|
}
|