updated vue-cli3 scaffolding. Items previously shown in the document were packaged and reported errors
after positioning, it is found that an error will be reported as long as the < script > tag is used in 2 .md files. There was no problem with the vue-cli2 project before.
related codes
configuration file.
chainWebpack: config = > {
config.module
.rule("md")
.test(/\.md$/)
.use("vue-loader")
.loader("vue-loader")
.end()
.use("vue-markdown-loader")
.loader("vue-markdown-loader/lib/markdown-compiler")
.options({
raw: true,
use: [
[require("markdown-it-anchor"), {
level: 2, // , : -sharp
permalink: true, //
permalinkBefore: true //
}],
// "markdown-it-container"
[require("markdown-it-container"), "demo", {
// ::: demo :::
validate: function (params) {
return params.trim().match(/^demo\s*(.*)$/)
},
// ,
render: function (tokens, idx) {
var m = tokens[idx].info.trim().match(/^demo\s*(.*)$/)
// nesting === 1
if (tokens[idx].nesting === 1) {
// ,::: demo xxxxxx
var description = (m && m.length > 1) ? m[1] : ""
//
var content = tokens[idx + 1].content
// html
var html = convert(striptags.strip(content, ["script", "style"])).replace(/(<[^>]*)=""(?=.*>)/g, "$1")
// script
var script = striptags.fetch(content, "script")
// style
var style = striptags.fetch(content, "style")
// prop,
var jsfiddle = {html: html, script: script, style: style}
//
var descriptionHTML = description
? md.render(description)
: ""
// jsfiddle,
jsfiddle = md.utils.escapeHtml(JSON.stringify(jsfiddle))
// ,demo-block,
return `<code-show class="demo-box" :jsfiddle="${jsfiddle}">
<div class="source" slot="source">${html}</div>
${descriptionHTML}
<div class="highlight" slot="highlight">`
}
//
return "</div></code-show>\n"
}
}],
[require("markdown-it-container"), "tip"],
[require("markdown-it-container"), "warning"]
],
//
preprocess: function (MarkdownIt, source) {
// markdowntable,
MarkdownIt.renderer.rules.table_open = function () {
return "<table class="table">"
}
// v-pre,
MarkdownIt.renderer.rules.fence = wrap(MarkdownIt.renderer.rules.fence)
return source
}
})
},
what result do you expect? What is the error message actually seen?
is there a big god to help see why? After looking for it for a while, I couldn"t find the reason