Skip to content

Commit

Permalink
fix: Update marked to latest and add heading id parsing. (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoramite committed Jul 14, 2023
1 parent 505d5f0 commit d22aba9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions packages/amagaki/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"@types/express-serve-static-core": "^4.17.21",
"@types/glob": "^7.1.3",
"@types/js-yaml": "^4.0.1",
"@types/marked": "^2.0.2",
"@types/marked": "^5.0.0",
"@types/mime-types": "^2.1.0",
"@types/node": "^18.11.18",
"@types/nunjucks": "^3.1.4",
Expand Down Expand Up @@ -86,7 +86,8 @@
"i": "^0.3.7",
"isomorphic-git": "^1.12.1",
"js-yaml": "^4.1.0",
"marked": "^2.0.3",
"marked": "^5.1.1",
"marked-gfm-heading-id": "^3.0.4",
"mime-types": "^2.1.30",
"minimatch": "^3.0.4",
"nunjucks": "^3.2.3",
Expand Down
7 changes: 5 additions & 2 deletions packages/amagaki/src/plugins/nunjucks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import {TemplateEngineComponent, TemplateEngineRenderResult} from '../templateEn
import {Translatable} from '../locale';
import {Url} from '../url';
import {formatBytes} from '../utils';
import marked from 'marked';
import { marked } from 'marked';
import { gfmHeadingId } from "marked-gfm-heading-id";

marked.use(gfmHeadingId());

/**
* Built-in Nunjucks filters.
Expand Down Expand Up @@ -45,7 +48,7 @@ export class NunjucksBuiltInFilters {
if (!value) {
return '';
}
return marked(value);
return marked.parse(value);
}

/**
Expand Down

0 comments on commit d22aba9

Please sign in to comment.