mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-06-08 17:37:24 +08:00
21 lines
711 B
JavaScript
21 lines
711 B
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.hoistPlugin = void 0;
|
|
// hoist <script> and <style> tags out of the returned html
|
|
// so that they can be placed outside as SFC blocks.
|
|
exports.hoistPlugin = (md) => {
|
|
const RE = /^<(script|style)(?=(\s|>|$))/i;
|
|
md.renderer.rules.html_block = (tokens, idx) => {
|
|
const content = tokens[idx].content;
|
|
const data = md.__data;
|
|
const hoistedTags = data.hoistedTags || (data.hoistedTags = []);
|
|
if (RE.test(content.trim())) {
|
|
hoistedTags.push(content);
|
|
return '';
|
|
}
|
|
else {
|
|
return content;
|
|
}
|
|
};
|
|
};
|
|
//# sourceMappingURL=hoist.js.map
|