Commit 25d69c42762314cefc1cd815f607cec421a93252

Authored by Andrey Karpikov
1 parent 6bb07f97

escape html for pre and code

@@ -377,11 +377,13 @@ module Kanjai @@ -377,11 +377,13 @@ module Kanjai
377 if !key.nil? and !value.nil? 377 if !key.nil? and !value.nil?
378 work_value = value.dup 378 work_value = value.dup
379 work_value.gsub!(/\r\n/, "#newline#") if !['code', 'pre'].include?(parent_node_name.to_s.downcase) 379 work_value.gsub!(/\r\n/, "#newline#") if !['code', 'pre'].include?(parent_node_name.to_s.downcase)
  380 + work_value = CGI::escapeHTML(work_value) if ['code', 'pre'].include?(parent_node_name.to_s.downcase)
380 new_text.gsub!(key, work_value.to_s.html_safe) 381 new_text.gsub!(key, work_value.to_s.html_safe)
381 end 382 end
382 end 383 end
383 end 384 end
384 new_text 385 new_text
  386 +
385 end 387 end
386 388
387 def self.replace_attributes_marker(attributes, hash_value) 389 def self.replace_attributes_marker(attributes, hash_value)
1 module Kanjai 1 module Kanjai
2 - VERSION = "0.0.371" 2 + VERSION = "0.0.372"
3 end 3 end