From 8a7f7ce3680b5ec5f42ad1b4ca0417d51217cb1b Mon Sep 17 00:00:00 2001 From: Hannes Mannerheim Date: Thu, 21 Jan 2016 02:47:34 +0100 Subject: [PATCH] bug with diaspora notices quoting tweets, unwrap p --- js/dom-functions.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/js/dom-functions.js b/js/dom-functions.js index f2cd216..59b9eb1 100644 --- a/js/dom-functions.js +++ b/js/dom-functions.js @@ -2028,6 +2028,12 @@ function buildQueetHtml(obj, idInStream, extraClasses, requeeted_by, isConversat } }); }); + + // if statusnetHTML is contains

:s, unwrap those (diaspora..) + statusnetHTML.children('p').each(function(){ + $(this).contents().unwrap(); + }); + // find a place in the queet-text for the quoted notices statusnetHTML = placeQuotedNoticesInQueetText(attachmentBuild.quotedNotices, statusnetHTML); statusnetHTML = statusnetHTML.html(); @@ -2099,7 +2105,7 @@ function placeQuotedNoticesInQueetText(quotedNotices,queetText) { quoteLinkFound = queetText.find('a[data-quote-url*="' + removeProtocolFromUrl(qoutedNotice.url) + '"]'); } if(quoteLinkFound.length>0) { - quoteLinkFound.each(function(){ + $.each(quoteLinkFound,function(){ $(this).addClass(qoutedNotice.class); $(this).attr('href',qoutedNotice.href); $(this).attr('data-quote-url',qoutedNotice.url); @@ -2187,15 +2193,13 @@ function buildAttachmentHTML(attachments){ && this.oembed.provider == 'Twitter') { var twitterHTML = '

\ - \ - ' + this.oembed.author_name + '\ - ' + this.oembed.title + '\ - \ -
\ -
' + this.oembed.oembedHTML + '
\ - '; + ' + this.oembed.author_name + '\ + ' + this.oembed.title + '\ + \ +
' + this.oembed.oembedHTML + '
\ + '; quotedNotices.push({ url: this.url, html: twitterHTML,