Use Micromark in lint-changelog script (#19603)
This commit is contained in:
1 parent
3247e2d65c
commit
1bc83147b3
1 file changed
+2
-4
@@ -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];
|
||||
|
||||
Reference in new issue
Block a user