Showing
2 changed files
with
4 additions
and
4 deletions
| ... | ... | @@ -45,7 +45,7 @@ module Kanjai |
| 45 | 45 | elements.each do |item| |
| 46 | 46 | case item[:name] |
| 47 | 47 | when 'text' |
| 48 | - content = item[:source] | |
| 48 | + content = item[:source].to_s.strip | |
| 49 | 49 | if current_page |
| 50 | 50 | content = content.gsub('###link###', current_page.menu_url(session[:scheme], lang = nil)) |
| 51 | 51 | .gsub('###title###', current_page.lang_attributes(I18n.locale, :title)) |
| ... | ... | @@ -173,7 +173,7 @@ module Kanjai |
| 173 | 173 | case item[:name] |
| 174 | 174 | when 'text' |
| 175 | 175 | lang = domain.page_langs.find_by_code(session[:current_locale]) |
| 176 | - content = item[:source] | |
| 176 | + content = item[:source].to_s.strip | |
| 177 | 177 | content = content.gsub('###CURRENT_LANG_TITLE###', lang.title) |
| 178 | 178 | .gsub('###CURRENT_LANG_CODE###', lang.code) |
| 179 | 179 | subparts << content |
| ... | ... | @@ -239,7 +239,7 @@ module Kanjai |
| 239 | 239 | elements.each do |item| |
| 240 | 240 | case item[:name] |
| 241 | 241 | when 'text' |
| 242 | - subparts << self.replace_text_marker(subparts.parent.name, item[:source], hash_value) | |
| 242 | + subparts << self.replace_text_marker(subparts.parent.name, item[:source].to_s.strip, hash_value) | |
| 243 | 243 | when 'repeat' |
| 244 | 244 | repeat_id = item[:attributes]['id'] |
| 245 | 245 | @repeat_type_index[repeat_id] ||= 0 | ... | ... |