alexdebril / rss-atom-bundle

RSS and Atom Bundle for Symfony
MIT License
139 stars 49 forks source link

In some cases description is now returned as HTML with special chars escaped. #134

Closed alexdebril closed 7 years ago

alexdebril commented 7 years ago

As seen with @mvar in issue #131, the description can be returned with special chars escaped. The point of the current issue is to solve this problem.

@mvar : can you give me examples of feeds with escaped special chars in the HTML description please ?

mvar commented 7 years ago

@alexdebril I could, but only tomorrow.

mvar commented 7 years ago

Looks like that same Blogspot blog mentioned earlier by me also falls under this issue.

        $url = 'http://googleadsdeveloper.blogspot.com/feeds/posts/default';
        $feed = $feedIo->read($url, null, $modifiedSince)->getFeed();

        /** @var Item $item */
        foreach ( $feed as $item ) {
            dump($item->toArray());
            break;
        }

Outputs:

DefaultController.php on line 144:
array:9 [▼
  "medias" => ArrayIterator {#619}
  "author" => Author {#647 ▶}
  "elements" => array:2 [▶]
  "categories" => []
  "title" => "Introducing Ads Data Hub: Next generation insights and reporting"
  "publicId" => "tag:blogger.com,1999:blog-7815614485808579332.post-57449942967151386"
  "description" => "<div dir="ltr" style="text-align: left;" trbidi="on">Mobile has fundamentally changed how we live our lives. With our devices never more than an arm’s len ▶"
  "lastModified" => "2017-05-24T19:00:50+03:00"
  "link" => "http://feedproxy.google.com/~r/GoogleAdsDeveloperBlog/~3/KaiIWabHH8U/introducing-ads-data-hub-next.html"
]
alexdebril commented 7 years ago

This issue will be solved with https://github.com/alexdebril/feed-io/issues/94

mvar commented 7 years ago

Great job! I will check this later.

BTW, does it make sense to push composer.lock to bundle repository?

alexdebril commented 7 years ago

Thank you, feel free to re-open the issue if something goes wrong with HTML decoding.

Yes it's relevant to push composer.lock for development purposes and for the continuous integration. Travis uses it to install dependencies before running unit tests.