Allow oneboxers to specify their simple_onebox text is unsafe

This commit is contained in:
tms 2013-02-19 12:06:35 -05:00
parent 6d06420583
commit 1a0b23fd2b
2 changed files with 7 additions and 1 deletions

View File

@ -20,6 +20,7 @@ module Oneboxer
@opts[:original_url] = @url @opts[:original_url] = @url
@opts[:text] = @opts['description'] @opts[:text] = @opts['description']
@opts[:unsafe] = true
begin begin
parsed = URI.parse(@url) parsed = URI.parse(@url)

View File

@ -12,7 +12,12 @@
{{#image}}<img src="{{image}}" class="thumbnail">{{/image}} {{#image}}<img src="{{image}}" class="thumbnail">{{/image}}
<h3><a href="{{original_url}}" target="_blank">{{title}}</a></h3> <h3><a href="{{original_url}}" target="_blank">{{title}}</a></h3>
{{#by_info}}<h4>{{by_info}}</h4>{{/by_info}} {{#by_info}}<h4>{{by_info}}</h4>{{/by_info}}
{{{text}}} {{#unsafe}}
{{text}}
{{/unsafe}}
{{^unsafe}}
{{{text}}}
{{/unsafe}}
</div> </div>
<div class='clearfix'></div> <div class='clearfix'></div>
</div> </div>