UNPKG

laif-ds

Version:

Design System di Laif con componenti React basati su principi di Atomic Design

52 lines (51 loc) 912 B
"use client"; const h = [ "autolink", "destinationLiteral", "destinationRaw", "reference", "titleQuote", "titleApostrophe" ]; o.peek = s; function k() { return { canContainEols: ["delete"], enter: { strikethrough: c }, exit: { strikethrough: a } }; } function f() { return { unsafe: [ { character: "~", inConstruct: "phrasing", notInConstruct: h } ], handlers: { delete: o } }; } function c(e) { this.enter({ type: "delete", children: [] }, e); } function a(e) { this.exit(e); } function o(e, l, r, i) { const n = r.createTracker(i), u = r.enter("strikethrough"); let t = n.move("~~"); return t += r.containerPhrasing(e, { ...n.current(), before: t, after: "~" }), t += n.move("~~"), u(), t; } function s() { return "~"; } export { k as gfmStrikethroughFromMarkdown, f as gfmStrikethroughToMarkdown };