Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate package description markup conversion #2103

Open
davidmhewitt opened this issue Dec 12, 2023 · 0 comments
Open

Investigate package description markup conversion #2103

davidmhewitt opened this issue Dec 12, 2023 · 0 comments
Labels
Good First Issue Small, self-contained issue. Good for newcomers, and/or should be an easy fix.

Comments

@davidmhewitt
Copy link
Member

davidmhewitt commented Dec 12, 2023

Problem

While reviewing #2099 , I noticed that we use the markup conversion routines in AppStream to convert app descriptions to plain text (albeit pre-formatted with bullet point characters etc):

public string? get_description () {
if (description == null) {
description = component.get_description ();
if (description == null) {
if (backend_details == null) {
populate_backend_details_sync ();
}
description = backend_details.description;
}
if (description == null) {
return null;
}
try {
// Condense double spaces
var space_regex = new Regex ("\\s+");
description = space_regex.replace (description, description.length, 0, " ");
} catch (Error e) {
warning ("Failed to condense spaces: %s", e.message);
}
try {
description = AppStream.markup_convert_simple (description);

Given the package descriptions are already formatted with the limited set of XML markup that AppStream supports, and in theory, the text display widgets in GTK support displaying that markup as-is, we might get some better visual results (and possibly accessibility) if we don't pre-process the markup.

Proposal

Investigate where we use the output from a package's get_description and see if the widget would support displaying XML markup natively (and look better) rather than the plain-textified markup created by markup_convert_simple

Additionally look if markup_convert_simple is used anywhere else and whether it should be.

Prior Art (Optional)

No response

@davidmhewitt davidmhewitt added the Good First Issue Small, self-contained issue. Good for newcomers, and/or should be an easy fix. label Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue Small, self-contained issue. Good for newcomers, and/or should be an easy fix.
Projects
None yet
Development

No branches or pull requests

1 participant