summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/rels/relationship.rb
diff options
context:
space:
mode:
authorStefan Daschek <[email protected]>2012-11-12 17:47:27 +0100
committerStefan Daschek <[email protected]>2012-11-12 17:47:27 +0100
commit2fa7e78e8e06758b68317b76d770a5673c93d99b (patch)
treeda710135051b155b065ce2b26387d2c84654e9c6 /lib/axlsx/rels/relationship.rb
parent49638e7b4120c22a9a90a6aa967f636a7056022e (diff)
downloadcaxlsx-2fa7e78e8e06758b68317b76d770a5673c93d99b.tar.gz
caxlsx-2fa7e78e8e06758b68317b76d770a5673c93d99b.zip
Escape URLs used as target for hyperlinks.
Up to now, when using an URL containing a & character, the generated XML was invalid.
Diffstat (limited to 'lib/axlsx/rels/relationship.rb')
-rw-r--r--lib/axlsx/rels/relationship.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/axlsx/rels/relationship.rb b/lib/axlsx/rels/relationship.rb
index 99c8e112..04911904 100644
--- a/lib/axlsx/rels/relationship.rb
+++ b/lib/axlsx/rels/relationship.rb
@@ -55,7 +55,7 @@ module Axlsx
h = self.instance_values
h[:Id] = 'rId' << rId.to_s
str << '<Relationship '
- str << h.map { |key, value| '' << key.to_s << '="' << value.to_s << '"'}.join(' ')
+ str << h.map { |key, value| '' << key.to_s << '="' << Axlsx::coder.encode(value.to_s) << '"'}.join(' ')
str << '/>'
end