You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are currently using this gem in our project https://github.com/AjuntamentdeBarcelona/decidim and we found a bug when having descriptions with single quotes in the description like s'explicarà.
I checked your gem and I see you are using html_escape for the title but not for the description. I just want to know if this is intended or not 😄
Thanks!
The text was updated successfully, but these errors were encountered:
Anybody who comes down this line trying to truncate description for whatever use and breaking the the layout for one way or another, the solution I implemented was via nokogiri:
def social_share_description(description)
doc = Nokogiri::HTML::DocumentFragment.parse(description)
doc.search('br').remove
doc.to_html
end
This sample strips off all the br tags, irregardless if they are written in <br>, <br />, <br >. You might need to require 'nokogiri'.
Hi there!
We are currently using this gem in our project https://github.com/AjuntamentdeBarcelona/decidim and we found a bug when having descriptions with single quotes in the description like
s'explicarà
.I checked your gem and I see you are using
html_escape
for the title but not for the description. I just want to know if this is intended or not 😄Thanks!
The text was updated successfully, but these errors were encountered: