From 1672df3dceebe885ded02530799a78d5a07be1d7 Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Tue, 12 Jan 2016 07:56:29 -0600 Subject: Added support of graphviz --- public/js/extra.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'public/js') diff --git a/public/js/extra.js b/public/js/extra.js index efc89ccb..07e85acc 100644 --- a/public/js/extra.js +++ b/public/js/extra.js @@ -167,6 +167,17 @@ function finishView(view) { console.error(err); } }); + //graphviz + var graphvizs = view.find(".graphviz.raw").removeClass("raw"); + graphvizs.each(function (key, value) { + try { + var graphviz = Viz($(value).text()); + $(value).html(graphviz); + $(value).parent().parent().replaceWith(value); + } catch (err) { + console.error(err); + } + }); //image href new window(emoji not included) var images = view.find("img.raw[src]").removeClass("raw"); images.each(function (key, value) { @@ -536,6 +547,8 @@ function highlightRender(code, lang) { return '