Plugins: Make "README" the default markdown request param (#58264)

* Plugins: Make README the default markdown request param

* undo devdboard changes

* fix missing prefix

* rm newline

* re-add space UFFFFF
This commit is contained in:
Will Browne 2022-11-07 11:16:17 +01:00 committed by GitHub
parent b1bfae0350
commit 09e8cff06e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -270,7 +270,7 @@ func (hs *HTTPServer) GetPluginMarkdown(c *models.ReqContext) response.Response
// fallback try readme
if len(content) == 0 {
content, err = hs.pluginMarkdown(c.Req.Context(), pluginID, "readme")
content, err = hs.pluginMarkdown(c.Req.Context(), pluginID, "help")
if err != nil {
return response.Error(501, "Could not get markdown file", err)
}

View File

@ -79,7 +79,7 @@ async function getPluginVersions(id: string, isPublished: boolean): Promise<Vers
async function getLocalPluginReadme(id: string): Promise<string> {
try {
const markdown: string = await getBackendSrv().get(`${API_ROOT}/${id}/markdown/help`);
const markdown: string = await getBackendSrv().get(`${API_ROOT}/${id}/markdown/README`);
const markdownAsHtml = markdown ? renderMarkdown(markdown) : '';
return markdownAsHtml;