Skip to content

Commit

Permalink
pkginfo: Fix flatpak description formatting.
Browse files Browse the repository at this point in the history
Use html2text to convert the appstream description.
  • Loading branch information
mtwebster committed Jul 9, 2024
1 parent b95e908 commit d9e30ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Depends: python3,
gir1.2-xapp-1.0,
gir1.2-appstream-1.0,
gir1.2-xmlb-2.0,
html2text,
mint-translations,
libgtk3-perl
${misc:Depends},
Expand Down
6 changes: 2 additions & 4 deletions usr/lib/python3/dist-packages/mintcommon/installer/pkgInfo.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import html2text
import sys
if sys.version_info.major < 3:
raise "python3 required"
Expand Down Expand Up @@ -372,10 +373,7 @@ def get_description(self, as_component=None):
description = as_component.get_description()

if description is not None:
description = description.replace("<p>", "").replace("</p>", "\n")
for tags in ["<ul>", "</ul>", "<li>", "</li>"]:
description = description.replace(tags, "")
self.description = capitalize(description)
self.description = html2text.html2text(description)

if self.description is None:
return ""
Expand Down

0 comments on commit d9e30ed

Please sign in to comment.