diff --git a/lib/chunks/category.rb b/lib/chunks/category.rb index d08d8636..33e51bc9 100644 --- a/lib/chunks/category.rb +++ b/lib/chunks/category.rb @@ -16,7 +16,7 @@ class Category < Chunk::Abstract def initialize(match_data, content) super(match_data, content) @hidden = match_data[1] - @list = match_data[2].split(',').map { |c| c.strip } + @list = match_data[2].split(',').map { |c| html_escape(c.strip) } @unmask_text = '' if @hidden @unmask_text = '' diff --git a/lib/chunks/chunk.rb b/lib/chunks/chunk.rb index 18de7d0c..f3384943 100644 --- a/lib/chunks/chunk.rb +++ b/lib/chunks/chunk.rb @@ -74,6 +74,13 @@ module Chunk @content.delete_chunk(self) end + def html_escape(string) + string.gsub( /&/, "&" ). + gsub( //, ">" ). + gsub( /"/, """ ) + end + end end