From 96f12919c07c0cfe804d01ee14ddc321d7532eba Mon Sep 17 00:00:00 2001 From: "Octavian R. Corlade" Date: Sun, 10 Sep 2017 17:51:29 +0200 Subject: [PATCH 1/2] Explicit XHTML namespace for
 instead of  for
 compatibility with bootstrap-datepicker

---
 inst/htmlwidgets/sankeyNetwork.js | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/inst/htmlwidgets/sankeyNetwork.js b/inst/htmlwidgets/sankeyNetwork.js
index f5cac1e0..8d758093 100755
--- a/inst/htmlwidgets/sankeyNetwork.js
+++ b/inst/htmlwidgets/sankeyNetwork.js
@@ -165,10 +165,9 @@ HTMLWidgets.widget({
             });
         // note: u2192 is right-arrow
         link.append("title")
-            .append("foreignObject")
-            .append("xhtml:body")
-            .html(function(d) { return "
" + d.source.name + " \u2192 " + d.target.name +
-                "\n" + format(d.value) + " " + options.units + "
"; }); + .append("xhtml:pre") + .text(function(d) { return d.source.name + " \u2192 " + d.target.name + + "\n" + format(d.value) + " " + options.units; }); node.append("rect") .attr("height", function(d) { return d.dy; }) @@ -179,10 +178,9 @@ HTMLWidgets.widget({ .style("opacity", 0.9) .style("cursor", "move") .append("title") - .append("foreignObject") - .append("xhtml:body") - .html(function(d) { return "
" + d.name + "
" + format(d.value) + - " " + options.units + "
"; }); + .append("xhtml:pre") + .text(function(d) { return d.name + "\n" + format(d.value) + + " " + options.units; }); node.append("text") .attr("x", -6) From 24c15ebc5edd649aaac6fbc7aad946012224f7a3 Mon Sep 17 00:00:00 2001 From: "Octavian R. Corlade" Date: Thu, 28 Sep 2017 15:02:59 +0200 Subject: [PATCH 2/2] Keep the foreignObject tag, use
, xhtml has no
 effect

---
 inst/htmlwidgets/sankeyNetwork.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/inst/htmlwidgets/sankeyNetwork.js b/inst/htmlwidgets/sankeyNetwork.js
index 8d758093..7cc43721 100755
--- a/inst/htmlwidgets/sankeyNetwork.js
+++ b/inst/htmlwidgets/sankeyNetwork.js
@@ -165,7 +165,8 @@ HTMLWidgets.widget({
             });
         // note: u2192 is right-arrow
         link.append("title")
-            .append("xhtml:pre")
+            .append("foreignObject")
+            .append("pre")
             .text(function(d) { return d.source.name + " \u2192 " + d.target.name +
                 "\n" + format(d.value) + " " + options.units; });
 
@@ -178,7 +179,8 @@ HTMLWidgets.widget({
             .style("opacity", 0.9)
             .style("cursor", "move")
             .append("title")
-            .append("xhtml:pre")
+            .append("foreignObject")
+            .append("pre")
             .text(function(d) { return d.name + "\n" + format(d.value) + 
                 " " + options.units; });