fix(core): update
This commit is contained in:
@ -7,11 +7,12 @@ export class SmartMarkdown {
|
||||
* converts markdown to html
|
||||
* @param mdString
|
||||
*/
|
||||
public markdownToHtml(mdString: string): string {
|
||||
return plugins.marked(mdString);
|
||||
public async markdownToHtml(mdString: string): Promise<string> {
|
||||
const result = await plugins.remark().use(plugins.remarkHtml).process(mdString);
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
public htmlToMarkdown(htmlString): string {
|
||||
public htmlToMarkdown(htmlString: string): string {
|
||||
const turndownInstance = new plugins.turndown({
|
||||
headingStyle: 'atx',
|
||||
codeBlockStyle: 'fenced',
|
||||
|
@ -1,5 +1,16 @@
|
||||
import marked = require('marked');
|
||||
|
||||
// third party remark
|
||||
import remark from 'remark';
|
||||
import remarkHtml from 'remark-html';
|
||||
|
||||
export {
|
||||
remark,
|
||||
remarkHtml
|
||||
}
|
||||
|
||||
// other third party stuff
|
||||
import turndown from 'turndown';
|
||||
// @ts-ignore
|
||||
import * as turndownPluginGfm from 'turndown-plugin-gfm';
|
||||
|
||||
export { marked, turndown, turndownPluginGfm };
|
||||
export { turndown, turndownPluginGfm };
|
||||
|
Reference in New Issue
Block a user