From 7576878ba50d581da671e06445758645f8e61be5 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Thu, 29 Jan 2015 21:40:21 +0000 Subject: [PATCH] Filter comments when generating palette tooltips Fixes #549 --- public/red/ui/palette.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/red/ui/palette.js b/public/red/ui/palette.js index 6a79438e9..ecdb3c80c 100644 --- a/public/red/ui/palette.js +++ b/public/red/ui/palette.js @@ -79,7 +79,11 @@ RED.palette = (function() { if (label != type) { l = "

"+label+"
"+type+"

"; } - popOverContent = $(l+($("script[data-help-name|='"+type+"']").html()||"

no information available

").trim()).slice(0,2); + + popOverContent = $(l+($("script[data-help-name|='"+type+"']").html()||"

no information available

").trim()) + .filter(function(n) { + return this.nodeType == 1 || (this.nodeType == 3 && this.textContent.trim().length > 0) + }).slice(0,2); } catch(err) { // Malformed HTML may cause errors. TODO: need to understand what can break console.log("Error generating pop-over label for '"+type+"'.");