Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strips iframe tags on ruby 2.1 #10

Open
PallaviTS opened this issue Mar 1, 2014 · 1 comment
Open

Strips iframe tags on ruby 2.1 #10

PallaviTS opened this issue Mar 1, 2014 · 1 comment

Comments

@PallaviTS
Copy link

@nono

2.0.0-p247 :061 > text = "<iframe width=640 height=360 src=//www.youtube.com/embed/WLIfmnlSkQ4?feature=player_detailpage frameborder=0 allowfullscreen></iframe>"
 => "<iframe width=640 height=360 src=//www.youtube.com/embed/WLIfmnlSkQ4?feature=player_detailpage frameborder=0 allowfullscreen></iframe>"
2.0.0-p247 :062 > HTML_Truncator.truncate(text, 2)
 => "<iframe width=\"640\" height=\"360\" src=\"//www.youtube.com/embed/WLIfmnlSkQ4?feature=player_detailpage\" frameborder=\"0\" allowfullscreen></iframe>"


2.1.0 :001 > text = "<iframe width=640 height=360 src=//www.youtube.com/embed/WLIfmnlSkQ4?feature=player_detailpage frameborder=0 allowfullscreen></iframe>"
 => "<iframe width=640 height=360 src=//www.youtube.com/embed/WLIfmnlSkQ4?feature=player_detailpage frameborder=0 allowfullscreen></iframe>"
2.1.0 :002 > HTML_Truncator.truncate(text, 2)
 => ""
2.1.0 :003 >
@nono
Copy link
Owner

nono commented Mar 2, 2014

As a workaround, you can put iframe in the self_closing_tags:

HTML_Truncator.self_closing_tags << "iframe"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants