/** Check if a tag marks a page as a meta page (exact "meta" or "meta/..." subtag) */ export function isMetaTag(tag: string): boolean { return tag === "meta" || tag.startsWith("meta/"); } /** Extract the name from hashtag text, removing # prefix and if necessary */ export function extractHashtag(text: string): string { if (text[0] !== "#") { // you shouldn't call this function at all console.error("extractHashtag called on already clean string", text); return text; } else if (text[1] === "<") { if (text.slice(-1) !== ">") { // this is malformed: # return text.slice(2, -1); } } else { // this is just #name return text.slice(1); } }