mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
parent
b1bfae0350
commit
09e8cff06e
@ -270,7 +270,7 @@ func (hs *HTTPServer) GetPluginMarkdown(c *models.ReqContext) response.Response
|
|||||||
|
|
||||||
// fallback try readme
|
// fallback try readme
|
||||||
if len(content) == 0 {
|
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 {
|
if err != nil {
|
||||||
return response.Error(501, "Could not get markdown file", err)
|
return response.Error(501, "Could not get markdown file", err)
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ async function getPluginVersions(id: string, isPublished: boolean): Promise<Vers
|
|||||||
|
|
||||||
async function getLocalPluginReadme(id: string): Promise<string> {
|
async function getLocalPluginReadme(id: string): Promise<string> {
|
||||||
try {
|
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) : '';
|
const markdownAsHtml = markdown ? renderMarkdown(markdown) : '';
|
||||||
|
|
||||||
return markdownAsHtml;
|
return markdownAsHtml;
|
||||||
|
Loading…
Reference in New Issue
Block a user