fix(core): update

This commit is contained in:
2021-10-04 13:54:59 +02:00
parent 6bd015e5bb
commit 75c62c01f5
4 changed files with 108 additions and 2 deletions

View File

@@ -8,7 +8,11 @@ export class SmartMarkdown {
* @param mdString
*/
public async markdownToHtml(mdString: string): Promise<string> {
const result = await plugins.remark().use(plugins.remarkHtml).process(mdString);
const result = await plugins
.remark()
.use(plugins.remarkHtml)
.use(plugins.remarkFrontmatter, ['yaml', 'toml'])
.process(mdString);
return result.toString();
}

View File

@@ -1,8 +1,9 @@
// third party remark
import remark from 'remark';
import remarkFrontmatter from 'remark-frontmatter';
import remarkHtml from 'remark-html';
export { remark, remarkHtml };
export { remark, remarkFrontmatter, remarkHtml };
// other third party stuff
import turndown from 'turndown';