From 3944be4cec67485d724c2af9ba82ba0cf4e3aac4 Mon Sep 17 00:00:00 2001 From: Matthew Stadelman Date: Mon, 5 Mar 2018 07:57:22 -0500 Subject: [PATCH] Escape all ampersands in relationship nodes with '&' Without this Nokogiri will downcase the attributes for some reason which I assume must be expected behavior since the issue hasn't been fixed. Issue Reference: https://github.com/sparklemotion/nokogiri/issues/961 --- lib/sablon/document_object_model/relationships.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sablon/document_object_model/relationships.rb b/lib/sablon/document_object_model/relationships.rb index 87e53dbc..54e9eea7 100644 --- a/lib/sablon/document_object_model/relationships.rb +++ b/lib/sablon/document_object_model/relationships.rb @@ -104,7 +104,7 @@ def next_rid # Builds the relationship WordML tag and returns it def relationship_tag(rel_attr) attr_str = rel_attr.map { |k, v| %(#{k}="#{v}") }.join(' ') - "" + "".gsub(/&(?!amp;)/, '&') end end end