Skip to content

Instantly share code, notes, and snippets.

View ChrisShank's full-sized avatar
🎯
Focusing

Chris Shank ChrisShank

🎯
Focusing
View GitHub Profile
@andymatuschak
andymatuschak / clozePromptPlugin.ts
Last active May 9, 2021 05:08
parsing SRS prompts from Markdown
import mdast from "mdast";
import remarkParse from "remark-parse";
import remarkStringify from "remark-stringify";
import unified from "unified";
import unist from "unist";
import { clozeNodeType, ClozePromptNode } from "./index";
// TODO: don't match clozes inside code and html blocks
const clozeRegexp = /^{(.+?)}/;
export default function clozePlugin(this: unified.Processor) {