Skip to content

Commit

Permalink
Fix import for mdast-util-from-markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
rwjblue committed Oct 15, 2021
1 parent fe3eece commit 5077d4a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Expand Up @@ -8,7 +8,7 @@ import { Plugin } from 'release-it';
import { format } from 'release-it/lib/util.js';
import tmp from 'tmp';
import execa from 'execa';
import parse from 'mdast-util-from-markdown';
import { fromMarkdown } from 'mdast-util-from-markdown';

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
Expand Down Expand Up @@ -187,7 +187,7 @@ export default class LernaChangelogGeneratorPlugin extends Plugin {
}

_findInsertOffset(oldContent) {
let ast = parse(oldContent);
let ast = fromMarkdown(oldContent);
let firstH2 = ast.children.find((it) => it.type === 'heading' && it.depth === 2);
return firstH2 ? firstH2.position.start.offset : 0;
}
Expand Down

0 comments on commit 5077d4a

Please sign in to comment.