Merge pull request #2764 from evazion/fix-raw-note-bodies

Use raw note body instead of sanitized body for note edit box.
This commit is contained in:
Albert Yi
2016-12-05 11:39:50 -08:00
committed by GitHub
2 changed files with 6 additions and 5 deletions

View File

@@ -714,7 +714,7 @@ Danbooru.Note = {
timeouts: [],
pending: {},
add: function(container, id, x, y, w, h, text) {
add: function(container, id, x, y, w, h, original_body, sanitized_body) {
var $note_box = Danbooru.Note.Box.create(id);
var $note_body = Danbooru.Note.Body.create(id);
@@ -724,11 +724,11 @@ Danbooru.Note = {
$note_box.data('height', h);
container.appendChild($note_box[0]);
container.appendChild($note_body[0]);
$note_body.data("original-body", text);
$note_body.data("original-body", original_body);
Danbooru.Note.Box.scale($note_box);
Danbooru.Note.Body.display_text($note_body, text);
Danbooru.Note.Body.display_text($note_body, sanitized_body);
if (Danbooru.Note.embed) {
Danbooru.Note.Body.display_text($note_box.children("div.note-box-inner-border"), text);
Danbooru.Note.Body.display_text($note_box.children("div.note-box-inner-border"), sanitized_body);
}
},
@@ -769,6 +769,7 @@ Danbooru.Note = {
$article.data("y"),
$article.data("width"),
$article.data("height"),
$article.data("body"),
$article.html()
);
});

View File

@@ -1 +1 @@
<article data-width="<%= note.width %>" data-height="<%= note.height %>" data-x="<%= note.x %>" data-y="<%= note.y %>" data-id="<%= note.id %>"><%= raw DText.sanitize(note.body) %></article>
<article data-width="<%= note.width %>" data-height="<%= note.height %>" data-x="<%= note.x %>" data-y="<%= note.y %>" data-id="<%= note.id %>" data-body="<%= note.body %>"><%= raw DText.sanitize(note.body) %></article>