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:
parent
74fe419659
commit
0827865804
@ -26,6 +26,7 @@
|
|||||||
#include <qjson/parser.h>
|
#include <qjson/parser.h>
|
||||||
|
|
||||||
#include "core/closure.h"
|
#include "core/closure.h"
|
||||||
|
#include "core/utilities.h"
|
||||||
#include "songinfotextview.h"
|
#include "songinfotextview.h"
|
||||||
|
|
||||||
const char* TwitterArtistInfo::kTwitterBucket = "id:twitter";
|
const char* TwitterArtistInfo::kTwitterBucket = "id:twitter";
|
||||||
@ -182,7 +183,8 @@ QString GenerateHtmlForTweetStream(const QVariantList& tweets) {
|
|||||||
int offset = 0;
|
int offset = 0;
|
||||||
foreach (const Entity& e, entities) {
|
foreach (const Entity& e, entities) {
|
||||||
// Write all the plain text up to this entity.
|
// 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.
|
// Set the next starting position for reading more plain text.
|
||||||
offset = e.end_index;
|
offset = e.end_index;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user