import { truncateMarkdown } from "./truncateMarkdown";
/** Extracts the values of all named anchors used in the Markdown string, i.e. of the form . */
const extractNamedAnchors = (markdown: string): string[] => {
const regex = new RegExp('[^<]*', "g");
const namedAnchors: string[] = [];
let results = regex.exec(markdown);
while (results !== null) {
namedAnchors.push(results[1]);
results = regex.exec(markdown);
}
return namedAnchors;
};
const utils = {
extractNamedAnchors,
truncateMarkdown,
};
export default utils;