Showing
2 changed files
with
4 additions
and
4 deletions
| ... | ... | @@ -317,12 +317,12 @@ module Kanjai |
| 317 | 317 | |
| 318 | 318 | def self.replace_text_marker(parent_node_name, text, hash_value) |
| 319 | 319 | new_text = text.dup |
| 320 | + | |
| 320 | 321 | if !hash_value.nil? and !text.nil? |
| 321 | 322 | hash_value.each do |key, value| |
| 322 | 323 | if !key.nil? and !value.nil? |
| 323 | - work_value = value | |
| 324 | - work_value.gsub!(/\r\n/, "#newline#") if !['code', 'pre'].include?(parent_node_name) | |
| 325 | - | |
| 324 | + work_value = value.dup | |
| 325 | + work_value.gsub!(/\r\n/, "#newline#") if !['code', 'pre'].include?(parent_node_name.to_s.downcase) | |
| 326 | 326 | new_text.gsub!(key, work_value) |
| 327 | 327 | end |
| 328 | 328 | end | ... | ... |