Something went wrong. Try again.
Monorepo for Tangled forked from tangled.org/core
Something went wrong. Try again.
123456789101112131415// @ts-checkimport { defineMdastPlugin } from "satteri";
// the go renderer's dashes (appview/pages/markup/extension/dashes.go), which the// posts are written for: `--` is an em dash, and a hyphen between two digits// (50-100) an en dash. satteri's own smart dashes make `--` an en dash instead, so// they're off (astro.config.mjs) and this does the dashes; code is left aloneexport const dashes = defineMdastPlugin({ name: "tangled-dashes", text(node, ctx) { const value = node.value.replace(/--/g, "\u2014").replace(/(\d)-(?=\d)/g, "$1\u2013"); if (value !== node.value) ctx.replaceNode(node, { type: "text", value }); },});