Coerce textual description to HTML when using gPodderShownotesHTML

Needed because model.py no longer does that automatically.
This commit is contained in:
Adam Voss 2017-04-06 16:06:53 -05:00
parent 8ad7279504
commit 08c8f4d194
1 changed files with 8 additions and 1 deletions

View File

@ -201,7 +201,14 @@ class gPodderShownotesHTML(gPodderShownotes):
else:
self._base_uri = episode.channel.url
self._loaded = False
self.html_view.load_html(episode.description_html, self._base_uri)
description = episode.description_html
if not description:
description = self.coerce_text_to_html(episode.description)
self.html_view.load_html(description, self._base_uri)
def coerce_text_to_html(self, text):
return text.replace('\n', '<br>')
def on_mouse_over(self, webview, hit_test_result, modifiers):
if hit_test_result.context_is_link():