Skip to content
This repository has been archived by the owner on Aug 31, 2022. It is now read-only.

Commit

Permalink
Escape all ampersands in relationship nodes with '&'
Browse files Browse the repository at this point in the history
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: sparklemotion/nokogiri#961
  • Loading branch information
stadelmanma committed Mar 5, 2018
1 parent bf18e55 commit 3944be4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/sablon/document_object_model/relationships.rb
Expand Up @@ -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(' ')
"<Relationship #{attr_str}/>"
"<Relationship #{attr_str}/>".gsub(/&(?!amp;)/, '&amp;')
end
end
end
Expand Down

0 comments on commit 3944be4

Please sign in to comment.