diff --git a/scripts/lint-changelog.js b/scripts/lint-changelog.js index cbb675d68..522e5af89 100644 --- a/scripts/lint-changelog.js +++ b/scripts/lint-changelog.js @@ -3,9 +3,8 @@ import assert from "node:assert/strict"; import fs from "node:fs"; import indexToPosition from "index-to-position"; +import { fromMarkdown } from "mdast-util-from-markdown"; import { outdent } from "outdent"; -import remarkParse from "remark-parse"; -import unified from "unified"; import { CHANGELOG_CATEGORIES } from "./utilities/changelog.js"; const CHANGELOG_DIR = "changelog_unreleased"; @@ -162,8 +161,7 @@ function getCommentDescription(content, comment) { // Forbid HTML in title // https://github.com/prettier/prettier/issues/17089 function validateTitle(displayPath, title) { - const processor = unified().use(remarkParse); - const tree = processor.runSync(processor.parse(title)); + const tree = fromMarkdown(title); assert.equal(tree.children.length, 1); assert.equal(tree.children[0].type, "paragraph"); const { children } = tree.children[0];