Load custom markdown-it-regex plugin with script-loader

This commit is contained in:
Yukai Huang 2016-10-12 14:37:32 +08:00
parent b73fcfc5c9
commit 895bf98b03

View file

@ -306,21 +306,21 @@ function finishView(view) {
}
});
//graphviz
var graphvizs = view.find(".graphviz.raw").removeClass("raw");
graphvizs.each(function (key, value) {
try {
var $value = $(value);
var $ele = $(value).parent().parent();
var graphvizs = view.find(".graphviz.raw").removeClass("raw");
graphvizs.each(function (key, value) {
try {
var $value = $(value);
var $ele = $(value).parent().parent();
var graphviz = Viz($value.text());
$value.html(graphviz);
var graphviz = Viz($value.text());
$value.html(graphviz);
$ele.addClass('graphviz');
$value.children().unwrap().unwrap();
} catch (err) {
console.warn(err);
}
});
$ele.addClass('graphviz');
$value.children().unwrap().unwrap();
} catch (err) {
console.warn(err);
}
});
//mermaid
var mermaids = view.find(".mermaid.raw").removeClass("raw");
@ -916,7 +916,7 @@ md.renderer.rules.fence = function (tokens, idx, options, env, self) {
};
/* Defined regex markdown it plugins */
var Plugin = require('markdown-it-regexp');
require('script!../vendor/markdown-it-regexp');
//youtube
var youtubePlugin = new Plugin(