Decode HTML entities in tweets.

This commit is contained in:
John Maguire 2012-06-20 15:16:56 +02:00
parent 74fe419659
commit 0827865804
1 changed files with 3 additions and 1 deletions

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;