1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-16 19:31:02 +01:00

Decode HTML entities in tweets.

This commit is contained in:
John Maguire 2012-06-20 15:16:56 +02:00
parent 74fe419659
commit 0827865804

View File

@ -26,6 +26,7 @@
#include <qjson/parser.h>
#include "core/closure.h"
#include "core/utilities.h"
#include "songinfotextview.h"
const char* TwitterArtistInfo::kTwitterBucket = "id:twitter";
@ -182,7 +183,8 @@ QString GenerateHtmlForTweetStream(const QVariantList& tweets) {
int offset = 0;
foreach (const Entity& e, entities) {
// Write all the plain text up to this entity.
writer.writeCharacters(text.mid(offset, e.start_index - offset));
writer.writeCharacters(Utilities::DecodeHtmlEntities(
text.mid(offset, e.start_index - offset)));
// Set the next starting position for reading more plain text.
offset = e.end_index;