Merge pull request #308 from yankee42/fixXmlEntities
authorDan Vanderkam <danvdk@gmail.com>
Thu, 21 Aug 2014 13:51:43 +0000 (09:51 -0400)
committerDan Vanderkam <danvdk@gmail.com>
Thu, 21 Aug 2014 13:51:43 +0000 (09:51 -0400)
Replace '&nbsp;' with '&#160;', so that the legend works in XHTML pages

plugins/legend.js

index 2ff9398..fb93b41 100644 (file)
@@ -249,7 +249,7 @@ generateLegendHTML = function(g, x, sel_points, oneEmWidth) {
 
     // TODO(danvk): use a template string here and make it an attribute.
     html += "<span" + cls + ">" + " <b><span style='color: " + series.color + ";'>" +
-        escapeHTML(pt.name) + "</span></b>:&nbsp;" + yval + "</span>";
+        escapeHTML(pt.name) + "</span></b>:&#160;" + yval + "</span>";
   }
   return html;
 };