From 37a5265534e59c4a1c4f13793d4f4f5c19993fb3 Mon Sep 17 00:00:00 2001 From: Yaroslav Serhieiev Date: Mon, 19 Feb 2024 19:02:20 +0200 Subject: [PATCH] feat: add GitHub flavored Markdown support (GFM) --- package.json | 1 + src/builtin-plugins/remark.ts | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index f1fe26c..00378f1 100644 --- a/package.json +++ b/package.json @@ -125,6 +125,7 @@ "rehype-sanitize": "^6.0.0", "rehype-stringify": "^10.0.0", "remark": "^15.0.1", + "remark-gfm": "^4.0.0", "remark-rehype": "^11.0.0", "rimraf": "^4.3.1", "stacktrace-js": "^2.0.2", diff --git a/src/builtin-plugins/remark.ts b/src/builtin-plugins/remark.ts index 7663a28..1930f59 100644 --- a/src/builtin-plugins/remark.ts +++ b/src/builtin-plugins/remark.ts @@ -7,16 +7,23 @@ export const remarkPlugin: PluginConstructor = () => { name: 'jest-allure2-reporter/plugins/remark', async globalContext(context) { const remark = await import('remark'); - const [remarkRehype, rehypeSanitize, rehypeStringify, rehypeHighlight] = - await Promise.all([ - import('remark-rehype'), - import('rehype-sanitize'), - import('rehype-stringify'), - import('rehype-highlight'), - ]); + const [ + remarkGfm, + remarkRehype, + rehypeSanitize, + rehypeStringify, + rehypeHighlight, + ] = await Promise.all([ + import('remark-gfm'), + import('remark-rehype'), + import('rehype-sanitize'), + import('rehype-stringify'), + import('rehype-highlight'), + ]); const processor = remark .remark() + .use(remarkGfm.default) .use(remarkRehype.default) .use(rehypeSanitize.default) .use(rehypeHighlight.default)