-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Adding support for markdown in checks description #17980
Conversation
Codecov Report
@@ Coverage Diff @@
## main #17980 +/- ##
==========================================
- Coverage 45.31% 45.28% -0.03%
==========================================
Files 819 820 +1
Lines 90863 90939 +76
==========================================
+ Hits 41173 41186 +13
- Misses 43134 43197 +63
Partials 6556 6556
Continue to review full report at Codecov.
|
Looks like a good idea but even Github just stored text and most of them are short. |
I agree it might be a specific use case but I use jenkins with checks plugin and it seems warnings-ng publishes analysis results as markdown tables. |
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: silverwind <me@silverwind.io>
* https://github.com/go-gitea/gitea: [skip ci] Updated translations via Crowdin Use non-expiring key. (go-gitea#17984) Co-Authored-By: silverwind <me@silverwind.io>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: silverwind <me@silverwind.io>
* 'main' of https://github.com/Caellion/gitea: Update web_src/less/_base.less Update templates/repo/pulls/status.tmpl Update templates/repo/commit_statuses.tmpl
Yeah, so the UI should consider both long markdown content and short plain content |
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
…kup.Sanitize(raw))` in `Markdown2html`
Co-authored-by: silverwind <me@silverwind.io>
I think we need to add something to the rendercontext here - for example I think it's likely that SHAs will be in these reports and you'll want to link to them. To that end we need to pass the repo and urlmetas |
Actually from what I have seen any links that might happen to be in the reports lead to the CI that generated them (for example to the build) rather than to somewhere in repo. |
} | ||
return template.HTML(markup.Sanitize(renderedContent)) | ||
} else if markupType == "markup" { | ||
if renderedContent, err = markup.RenderString(&markup.RenderContext{}, raw); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has already included markdown rendering.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And it seems we just needs markdown
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was requested by sliverwind . #17980 (review)
Personally I also prefer to keep it simple and only introduce one render.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I guess we can actually simplify and only support markdown, at least until we can detect other types (like RST) based on entered content.
By the way, is there speaking anything against just using Str2html?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIR it didn't render markdown tables
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah seems like Str2html
is mislabeled and actually renders HTML strings into template.HMTL, so markdown.RenderString
seems fine.
* 'main' of https://github.com/go-gitea/gitea: (87 commits) Fix template bug of LFS lock (go-gitea#18784) Various Mermaid improvements (go-gitea#18776) [skip ci] Updated translations via Crowdin Fix display time of milestones (go-gitea#18753) [skip ci] Updated translations via Crowdin Prevent dangling GetAttribute calls (go-gitea#18754) Add example to render html files (go-gitea#18736) Fix a broken link in `commits_list_small.tmpl` (go-gitea#18763) Fix broken cancel button link on patch page (go-gitea#18718) Ignore the migrate if u2f_registration is not exist (go-gitea#18760) [skip ci] Updated translations via Crowdin Increase the size of the webauthn_credential credential_id field (go-gitea#18739) Fix isempty detection of git repository (go-gitea#18746) [skip ci] Updated translations via Crowdin Send mail to issue/pr assignee/reviewer also when OnMention is set (go-gitea#18707) Reduce CI go module downloads, add make targets (go-gitea#18708) Add number in queue status to monitor page (go-gitea#18712) Fix source code line highlighting (go-gitea#18729) Fix forked repositories missed tags (go-gitea#18719) [skip ci] Updated translations via Crowdin ...
I'm not sure if "status" is the appropriate place for this as it could seriously increase page load size, perhaps another field such as how github does it (see "checks" page on PRs) (I'm for collecting this information, just in a different field to keep the status lightweight) |
FYI: another merged PR has introduced another RenderMarkdownToHtml
gitea/modules/templates/helper.go Line 165 in 43332a4
|
Or we can have two columns, one is for status, another is for description which allow markdown renderering. |
So this PR gets stale and I guess most people prefer to keep the "status description" as simple as possible, so the "markdown rendering" is not accepted, right? |
I myself couldn't find enough reason to support markdown there. |
Does GitHub support markdown there? |
If I understand correctly, GitHub only shows simple text for the status. Maybe it's good to keep that field simple. And this PR has been stale for a long time and I can't think of a way to handling it other than closing it. Feel free to reopen if there's any new progress and I could also help. |
They say image is worth a thousand words, so let me say, provides this: