From d025e30e4d815b50836dcc84e0149e9435631f76 Mon Sep 17 00:00:00 2001 From: toyg Date: Thu, 16 Jan 2014 15:14:25 +0000 Subject: [PATCH 1/2] format DM display - fixes miguelfreitas/twister-html#43 --- twister_formatpost.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/twister_formatpost.js b/twister_formatpost.js index f03fb3e..e51d7d2 100644 --- a/twister_formatpost.js +++ b/twister_formatpost.js @@ -116,7 +116,8 @@ function dmDataToSnippetItem(dmData, remoteUser) { dmItem.find("a.dm-chat-link").attr("href", $.MAL.dmchatUrl(remoteUser)); getAvatar( remoteUser, dmItem.find(".post-photo").find("img") ); getFullname( remoteUser, dmItem.find("a.post-info-name") ); - dmItem.find(".post-text").text(escapeHtmlEntities(dmData.text)); + var mentions = []; + htmlFormatMsg(dmData.text, dmItem.find(".post-text"), mentions); dmItem.find(".post-info-time").text(timeGmtToText(dmData.time)); dmItem.find(".post-info-time").attr("title",timeSincePost(dmData.time)); From 0cf2b79a0cec9d2d429776282be2da13db9ac53a Mon Sep 17 00:00:00 2001 From: toyg Date: Thu, 16 Jan 2014 23:35:31 +0000 Subject: [PATCH 2/2] switched to html() --- twister_formatpost.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/twister_formatpost.js b/twister_formatpost.js index e51d7d2..aac980c 100644 --- a/twister_formatpost.js +++ b/twister_formatpost.js @@ -116,8 +116,7 @@ function dmDataToSnippetItem(dmData, remoteUser) { dmItem.find("a.dm-chat-link").attr("href", $.MAL.dmchatUrl(remoteUser)); getAvatar( remoteUser, dmItem.find(".post-photo").find("img") ); getFullname( remoteUser, dmItem.find("a.post-info-name") ); - var mentions = []; - htmlFormatMsg(dmData.text, dmItem.find(".post-text"), mentions); + dmItem.find(".post-text").html(escapeHtmlEntities(dmData.text)); dmItem.find(".post-info-time").text(timeGmtToText(dmData.time)); dmItem.find(".post-info-time").attr("title",timeSincePost(dmData.time));