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

Release body being inserted as raw markdown #43

Open
GammaGames opened this issue Sep 23, 2021 · 3 comments
Open

Release body being inserted as raw markdown #43

GammaGames opened this issue Sep 23, 2021 · 3 comments
Labels
Bitesize Small, self-contained issue. Good for newcomers, and/or should be an easy fix. Priority: Medium Should be addressed when time allows Status: Confirmed Verified by someone other than the reporter

Comments

@GammaGames
Copy link

What Happened

The markdown formatting, it's gone!
Screenshot from 2021-09-23 08 48 40

Steps to Reproduce

The only difference I can see is that Danielle made the releases for the repos that aren't working, as opposed to the bot. All of the repos with user-created releases have the issue, but Calendar and Appcenter are the others I spotted that have side-by-side releases with the bug.

@rajnish254
Copy link

Assign me that issue
Thanks

@vikash202245
Copy link

assign me that issue
thanks

@lewisgoddard lewisgoddard added the Status: Confirmed Verified by someone other than the reporter label Oct 24, 2022
@lewisgoddard lewisgoddard added Bitesize Small, self-contained issue. Good for newcomers, and/or should be an easy fix. Hacktoberfest Used in the month of October for good issues for new contributors Priority: Medium Should be addressed when time allows and removed Hacktoberfest Used in the month of October for good issues for new contributors labels Nov 17, 2022
@JBanks
Copy link

JBanks commented Mar 29, 2023

This inconsistency comes from GitHub actions outputting results from https://github.com/elementary/actions/blob/8522acaed6fd21d7854015dce74ebc76514d7590/release/entrypoint.sh#L57 which pulls the xml data from the appdata.xml file https://github.com/elementary/sideload/blob/1bce9873214f97fdd075f3673c77e8d60c101c66/data/sideload.appdata.xml.in#L46-L53. This XML data happens to also be valid HTML, so it gets displayed properly.

One solution to parse the markdown would be to pass the request back to the GitHub API using the requests python package. It could probably go somewhere around here:

"body": release.body,

headers = {
    "Accept": "application/vnd.github+json", 
    "Authorization": os.environ['GITHUB_TOKEN'], 
    "X-GitHub-Api-Version": "2022-11-28"
}
requests.post("https://api.github.com/markdown", headers=headers, json={"text": release.body})

Because GitHub supports all these HTML elements inside of its Markdown parser, you won't need to validate the source, and can run it on every release.

I don't know how well supported HTML list elements are in python libraries, but it may be best to use the GitHub API so that you will always know that you're supporting all the same features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bitesize Small, self-contained issue. Good for newcomers, and/or should be an easy fix. Priority: Medium Should be addressed when time allows Status: Confirmed Verified by someone other than the reporter
Projects
None yet
Development

No branches or pull requests

5 participants