aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Legler <a3li@gentoo.org>2011-10-22 17:21:12 +0200
committerAlex Legler <a3li@gentoo.org>2011-10-22 17:21:12 +0200
commitc243f2bf92ed9fd6445146761037cbcf807bb65f (patch)
treea9d55cdf51bf100a7d2a7ecfd974e6caf5949fd2
parentComment out XML wellformedness test, currently not used (diff)
downloadglsamaker-c243f2bf92ed9fd6445146761037cbcf807bb65f.tar.gz
glsamaker-c243f2bf92ed9fd6445146761037cbcf807bb65f.tar.bz2
glsamaker-c243f2bf92ed9fd6445146761037cbcf807bb65f.zip
Handle nil values as input to the Kramdown converter
-rw-r--r--app/helpers/glsa_helper.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/helpers/glsa_helper.rb b/app/helpers/glsa_helper.rb
index 5140ce8..dc8f160 100644
--- a/app/helpers/glsa_helper.rb
+++ b/app/helpers/glsa_helper.rb
@@ -153,7 +153,7 @@ module GlsaHelper
end
def xml_format(str)
- content = Kramdown::Document.new(str).to_xml
+ content = Kramdown::Document.new(str || "").to_xml
content.gsub! "<p><code>", "<code>"
content.gsub! "</code></p>", "</code>"
@@ -166,7 +166,7 @@ module GlsaHelper
end
def html_format(str)
- content = Kramdown::Document.new(str).to_xml
+ content = Kramdown::Document.new(str || "").to_xml
content.gsub! "<p><code>", "<code>"
content.gsub! "</code></p>", "</code>"