Skip to content

Commit

Permalink
Interoperability hack
Browse files Browse the repository at this point in the history
  • Loading branch information
valeriangalliat committed Sep 15, 2021
1 parent e56e915 commit 6fcc502
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,11 @@ anchor.defaults = {
permalinkAttrs: permalink.ariaHidden.defaults.renderAttrs
}

// Dirty hack to make `import anchor from 'markdown-it-anchor'` work with
// TypeScript which doesn't support the `module` field of `package.json` and
// will always get the CommonJS version which otherwise wouldn't have a
// `default` key, resulting in markdown-it-anchor being undefined when being
// imported that way.
anchor.default = anchor

export default anchor

0 comments on commit 6fcc502

Please sign in to comment.