bug with diaspora notices quoting tweets, unwrap p

This commit is contained in:
Hannes Mannerheim 2016-01-21 02:47:34 +01:00
parent 3b39b3fc43
commit 8a7f7ce368

View File

@ -2028,6 +2028,12 @@ function buildQueetHtml(obj, idInStream, extraClasses, requeeted_by, isConversat
} }
}); });
}); });
// if statusnetHTML is contains <p>:s, unwrap those (diaspora..)
statusnetHTML.children('p').each(function(){
$(this).contents().unwrap();
});
// find a place in the queet-text for the quoted notices // find a place in the queet-text for the quoted notices
statusnetHTML = placeQuotedNoticesInQueetText(attachmentBuild.quotedNotices, statusnetHTML); statusnetHTML = placeQuotedNoticesInQueetText(attachmentBuild.quotedNotices, statusnetHTML);
statusnetHTML = statusnetHTML.html(); statusnetHTML = statusnetHTML.html();
@ -2099,7 +2105,7 @@ function placeQuotedNoticesInQueetText(quotedNotices,queetText) {
quoteLinkFound = queetText.find('a[data-quote-url*="' + removeProtocolFromUrl(qoutedNotice.url) + '"]'); quoteLinkFound = queetText.find('a[data-quote-url*="' + removeProtocolFromUrl(qoutedNotice.url) + '"]');
} }
if(quoteLinkFound.length>0) { if(quoteLinkFound.length>0) {
quoteLinkFound.each(function(){ $.each(quoteLinkFound,function(){
$(this).addClass(qoutedNotice.class); $(this).addClass(qoutedNotice.class);
$(this).attr('href',qoutedNotice.href); $(this).attr('href',qoutedNotice.href);
$(this).attr('data-quote-url',qoutedNotice.url); $(this).attr('data-quote-url',qoutedNotice.url);
@ -2187,15 +2193,13 @@ function buildAttachmentHTML(attachments){
&& this.oembed.provider == 'Twitter') { && this.oembed.provider == 'Twitter') {
var twitterHTML = '<div class="oembed-item-header">\ var twitterHTML = '<div class="oembed-item-header">\
<span class="oembed-item-title">\ <span class="oembed-item-title">' + this.oembed.author_name + '</span>\
' + this.oembed.author_name + '\ <span class="oembed-twitter-username">' + this.oembed.title + '</span>\
<span class="oembed-twitter-username">' + this.oembed.title + '</span>\ </div>\
</span>\ <div class="oembed-item-body">' + this.oembed.oembedHTML + '</div>\
</div>\ <div class="oembed-item-footer">\
<div class="oembed-item-body">' + this.oembed.oembedHTML + '</div>\ <span class="oembed-item-provider">' + this.oembed.provider + '</span>\
<div class="oembed-item-footer">\ </div>';
<span class="oembed-item-provider">' + this.oembed.provider + '</span>\
</div>';
quotedNotices.push({ quotedNotices.push({
url: this.url, url: this.url,
html: twitterHTML, html: twitterHTML,