Skip to content

Commit

Permalink
feat: add GitHub flavored Markdown support (GFM)
Browse files Browse the repository at this point in the history
  • Loading branch information
noomorph committed Feb 19, 2024
1 parent 8f55749 commit 37a5265
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
21 changes: 14 additions & 7 deletions src/builtin-plugins/remark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 37a5265

Please # to comment.