Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX: prevent iframe in expended quote
- Loading branch information
Showing
1 changed file
with
3 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,7 +131,9 @@ Discourse.PostView = Discourse.GroupedView.extend(Ember.Evented, { | |
topicId = parseInt(topicId, 10); | ||
|
||
Discourse.ajax("/posts/by_number/" + topicId + "/" + postId).then(function (result) { | ||
var parsed = $(result.cooked); | ||
// slightly double escape the cooked html to prevent jQuery from unescaping it | ||
var escaped = result.cooked.replace("&", "&"); | ||
var parsed = $(escaped); | ||
parsed.replaceText(originalText, "<span class='highlighted'>" + originalText + "</span>"); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ZogStriP
Author
Member
|
||
$blockQuote.showHtml(parsed, 'fast', finished); | ||
}); | ||
|
Can we not just use .innerHTML here and bypass jQuery and the hack ?