@@ 1,4 1,4 @@
-# Copyright © 2019 José Alberto Orejuela García (josealberto4444)
+# Copyright © 2019-2020 José Alberto Orejuela García (josealberto4444)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@@ 90,6 90,7 @@ class Apod:
explanation = explanation.replace('\n>', '>') # Fix split HTML tags.
explanation = explanation.replace('<a/>', '</a>') # Fix typos (they seem to write the HTML by hand, yes).
explanation = explanation.replace('\n', ' ') # Delete all newlines.
+ explanation = explanation.replace('<br>', ' ') # Delete all HTML newlines.
explanation = re.sub('\s+', ' ', explanation).strip() # Substitute repeated spaces and strips the ones at the beginning and the end of the string.
explanation = re.sub(r'<a([^>]*)href=["\'](?!http)([^"\']*)["\']([^>]*)>', r'<a\1href="https://apod.nasa.gov/apod/\2"\3>', explanation) # Change relative paths to absolute.
return explanation