Markdown: Replace rendering library (#17686)

* Replace remarkable with marked

* Add wrapper and options for marked
This commit is contained in:
Tobias Skarhed
2019-06-26 13:15:45 +02:00
committed by GitHub
parent 6fb36e705f
commit 8541214c9e
11 changed files with 54 additions and 61 deletions

View File

@@ -1,6 +1,5 @@
import React, { PureComponent } from 'react';
// @ts-ignore
import Remarkable from 'remarkable';
import { renderMarkdown } from '@grafana/data';
import { getBackendSrv } from '@grafana/runtime';
interface Props {
@@ -39,8 +38,7 @@ export class PluginHelp extends PureComponent<Props, State> {
getBackendSrv()
.get(`/api/plugins/${plugin.id}/markdown/${type}`)
.then((response: string) => {
const markdown = new Remarkable();
const helpHtml = markdown.render(response);
const helpHtml = renderMarkdown(response);
if (response === '' && type === 'help') {
this.setState({