import utils from "./markdown.utils";
describe("Markdown utils", () => {
it("should extract named anchors from the Markdown", () => {
const namedAnchors = utils.extractNamedAnchors(
'# Header\n\nsome text\n\n## point 1\n\n## point 2',
);
expect(namedAnchors).toStrictEqual(["anchor1", "anchor2"]);
});
it("should not extract named anchors from the Markdown that are not following the expected format", () => {
const namedAnchors = utils.extractNamedAnchors(
'# link text \n\n## point 2',
);
expect(namedAnchors).toStrictEqual([]);
});
});