Skip to content

Commit

Permalink
Show URL attributes after applying Handlebars.SafeString
Browse files Browse the repository at this point in the history
* Show URL attributes after applying Handlebars.SafeString; Fix #2338

* Check if string before applying safestring.
  • Loading branch information
marceloschmidt authored and engelgabriel committed Apr 4, 2016
1 parent 9f44a4f commit c1c0867
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/rocketchat-oembed/client/oembedUrlWidget.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ getDescription = (self) ->

Template.oembedUrlWidget.helpers
description: ->
return getDescription this
description = getDescription this
return new Handlebars.SafeString description if _.isString description

title: ->
return getTitle this
title = getTitle this
return new Handlebars.SafeString title if _.isString title

image: ->
if not this.meta?
Expand Down
2 changes: 1 addition & 1 deletion packages/rocketchat-oembed/client/oembedUrlWidget.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<div style="color: #AAA;">{{parsedUrl.host}}</div>
{{#if title}}
<div>
<a href="{{url}}" target="_blank"><strong>{{title}}</strong></a>
<a href="{{url}}" target="_blank"><strong>{{{title}}}</strong></a>
</div>
{{/if}}
{{{description}}}
Expand Down

0 comments on commit c1c0867

Please sign in to comment.