app/helpers/wcc/contentful/app/section_helper.rb in wcc-contentful-app-1.2.0 vs app/helpers/wcc/contentful/app/section_helper.rb in wcc-contentful-app-1.2.1
- old
+ new
@@ -16,11 +16,11 @@
def section_css_name(section)
section_template_name(section).dasherize
end
def section_styles(section)
- section_styles = ['section-' + section_css_name(section)]
+ section_styles = ["section-#{section_css_name(section)}"]
if styles = section.try(:styles)
section_styles.push(styles.map { |style| style.downcase.gsub(/[^\w]/, '-') })
elsif style = section.try(:style)
section_styles.push(style.downcase.gsub(/[^\w]/, '-'))
else
@@ -47,11 +47,11 @@
def safe_line_break(text, options = {})
return unless text.present?
text = CGI.escapeHTML(text)
- text = text.gsub(/\&(nbsp|vert|\#\d+);/, '&\1;')
- .gsub(/\<br\/?\>/, '<br/>')
+ text = text.gsub(/&(nbsp|vert|\#\d+);/, '&\1;')
+ .gsub(/<br\/?>/, '<br/>')
content_tag(:span, text.html_safe, {
class: 'safe-line-break'
}.merge(options))
end