UNPKG

synapse-react-client

Version:

[![npm version](https://badge.fury.io/js/synapse-react-client.svg)](https://badge.fury.io/js/synapse-react-client) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettie

29 lines (28 loc) 713 B
import { jsx as t } from "react/jsx-runtime"; const l = { 1: "toc-indent1", 2: "toc-indent2", 3: "toc-indent3", 4: "toc-indent4", 5: "toc-indent5", 6: "toc-indent6" }; function h(c) { const { originalMarkup: i } = c, e = [], r = /<h([1-6]) id="(.*)" .*toc="true">(.*)<\/h[1-6]>/gm; let o = ""; return i.replace(r, (s, d, a, n) => (o += n, e.push( /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t( "a", { role: "link", className: `link ${l[Number(d)]}`, "data-anchor": a, children: n } ) }, n) ), "")), /* @__PURE__ */ t("div", { children: e }, o); } export { h as default }; //# sourceMappingURL=MarkdownTableOfContents.js.map