1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Configure marked once on start-up

This commit is contained in:
Nick O'Leary 2015-01-29 20:47:30 +00:00
parent da67e69544
commit 083e253e45

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013 IBM Corp. * Copyright 2013, 2015 IBM Corp.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -14,7 +14,18 @@
* limitations under the License. * limitations under the License.
**/ **/
RED.sidebar.info = (function() { RED.sidebar.info = (function() {
marked.setOptions({
renderer: new marked.Renderer(),
gfm: true,
tables: true,
breaks: false,
pedantic: false,
sanitize: true,
smartLists: true,
smartypants: false
});
var content = document.createElement("div"); var content = document.createElement("div");
content.id = "tab-info"; content.id = "tab-info";
content.style.paddingTop = "4px"; content.style.paddingTop = "4px";
@ -97,16 +108,6 @@ RED.sidebar.info = (function() {
if (node._def.info) { if (node._def.info) {
var info = node._def.info; var info = node._def.info;
marked.setOptions({
renderer: new marked.Renderer(),
gfm: true,
tables: true,
breaks: false,
pedantic: false,
sanitize: true,
smartLists: true,
smartypants: false
});
table += '<div class="node-help">'+marked(typeof info === "function" ? info.call(node) : info)+'</div>'; table += '<div class="node-help">'+marked(typeof info === "function" ? info.call(node) : info)+'</div>';
//table += '<div class="node-help">'+(typeof info === "function" ? info.call(node) : info)+'</div>'; //table += '<div class="node-help">'+(typeof info === "function" ? info.call(node) : info)+'</div>';
} }