diff --git a/app/helpers/format_helper.rb b/app/helpers/format_helper.rb index 9289b79c..9dc7abc5 100644 --- a/app/helpers/format_helper.rb +++ b/app/helpers/format_helper.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +require 'redcarpet/render_strip' module FormatHelper ## @@ -206,6 +207,11 @@ module FormatHelper markdown("#{text} Please look at #{link_to '**Markdown Syntax**', 'https://daringfireball.net/projects/markdown/syntax', target: '_blank'} to format your text", false) end + # Return a plain text markdown stripped of formatting. + def plain_text(content) + Redcarpet::Markdown.new(Redcarpet::Render::StripDown).render(content) + end + def quantity_left_of(resource) return '-/-' if resource.quantity.blank? diff --git a/app/views/conferences/_sponsors.haml b/app/views/conferences/_sponsors.haml index 5d7bbaa9..ba74c331 100644 --- a/app/views/conferences/_sponsors.haml +++ b/app/views/conferences/_sponsors.haml @@ -27,9 +27,9 @@ .row .col-md-12 %h3.text-center - Want to sponsor? + = "Interested in sponsoring #{conference.title}?" = link_to(sponsorship_mailto(conference)) do - Contact us! + Please, contact us! - sponsors.each do |sponsor| - content_for :modals do diff --git a/app/views/conferences/show.html.haml b/app/views/conferences/show.html.haml index c478a8a2..f067fe2d 100644 --- a/app/views/conferences/show.html.haml +++ b/app/views/conferences/show.html.haml @@ -1,10 +1,10 @@ - content_for :head do %meta{ property: "og:title", content: @conference.title } %meta{ property: "og:site_name", content: (ENV['OSEM_NAME'] || 'OSEM') } - %meta{ property: "og:description", content: @conference.description } + %meta{ property: "og:description", content: plain_text(@conference.description) } %meta{ property: "og:url", content: conference_url(@conference.short_title) } %meta{ property: "twitter:title", content: (@conference.title) } - %meta{ property: "twitter:description", content: @conference.description } + %meta{ property: "twitter:description", content: plain_text(@conference.description) } - if @conference.picture? %meta{ property: "og:image", content: @image_url } %meta{ property: "og:image:secure_url", content: @image_url }