Skip to content

Commit

Permalink
Ensure pack is available within md.renderer.rules.image
Browse files Browse the repository at this point in the history
  • Loading branch information
confused-Techie committed Jan 8, 2024
1 parent 2775170 commit 494e155
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ function addCustomMarkdownHandling () {
let defaultImageRender = md.renderer.rules.image;

md.renderer.rules.image = function(tokens, idx, options, env, self) {
// HACK: Get the `pack` object from an outer scope so that we don't have
// to redefine this handler on every request.
let pack = currentPackage;
let token = tokens[idx];
let aIndex = token.attrIndex('src');

Expand Down

0 comments on commit 494e155

Please sign in to comment.