From 083e253e45133630638dc42034da7da9c4363cad Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Thu, 29 Jan 2015 20:47:30 +0000 Subject: [PATCH] Configure marked once on start-up --- public/red/ui/tab-info.js | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/public/red/ui/tab-info.js b/public/red/ui/tab-info.js index 323ebb495..cf3e6a550 100644 --- a/public/red/ui/tab-info.js +++ b/public/red/ui/tab-info.js @@ -1,5 +1,5 @@ /** - * Copyright 2013 IBM Corp. + * Copyright 2013, 2015 IBM Corp. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,18 @@ * limitations under the License. **/ 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"); content.id = "tab-info"; content.style.paddingTop = "4px"; @@ -97,16 +108,6 @@ RED.sidebar.info = (function() { if (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 += '
'+marked(typeof info === "function" ? info.call(node) : info)+'
'; //table += '
'+(typeof info === "function" ? info.call(node) : info)+'
'; }