@brillout/docpress 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -51,14 +51,26 @@ ${headingsExportCode}
51
51
  return codeNew;
52
52
  }
53
53
  function parseMarkdownHeading(line) {
54
+ var _a;
54
55
  const [lineBegin, ...lineWords] = line.split(" ");
55
56
  assert(lineBegin.split("#").join("") === "", { line, lineWords });
56
57
  const headingLevel = lineBegin.length;
57
58
  const titleMdx = lineWords.join(" ");
58
59
  assert(!titleMdx.startsWith(" "), { line, lineWords });
59
60
  assert(titleMdx, { line, lineWords });
60
- const headingId = determineSectionUrlHash(titleMdx);
61
- const title = titleMdx;
61
+ const headingMdx = {
62
+ title: titleMdx,
63
+ anchor: titleMdx
64
+ };
65
+ {
66
+ const customAnchor = (_a = /(?<={#).*(?=})/g.exec(titleMdx)) == null ? void 0 : _a[0];
67
+ if (customAnchor) {
68
+ headingMdx.anchor = customAnchor;
69
+ headingMdx.title = titleMdx.replace(/{#.*}/g, "");
70
+ }
71
+ }
72
+ const headingId = determineSectionUrlHash(headingMdx.anchor);
73
+ const title = headingMdx.title;
62
74
  const titleParsed = parseTitle(title);
63
75
  assert(headingId === null || headingId.length > 0);
64
76
  const headingAttrId = headingId === null ? "" : ` id="${headingId}"`;
package/dist/cli/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  vite_config_default
3
- } from "../chunk-Y6IB6PHW.js";
3
+ } from "../chunk-REPAOCCC.js";
4
4
  import "../chunk-MWMYEK3D.js";
5
5
  import "../chunk-2ZTPUQGS.js";
6
6
  import "../chunk-3QC7HYIF.js";
@@ -16,7 +16,7 @@ Error.stackTraceLimit = Infinity;
16
16
  cli();
17
17
  async function cli() {
18
18
  if (isDev) {
19
- await import("../devServer-TUR62GMN.js");
19
+ await import("../devServer-MLU3NNYM.js");
20
20
  } else if (isBuild) {
21
21
  await build(vite_config_default);
22
22
  await build({ ...vite_config_default, build: { ssr: true } });
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  vite_config_default
3
- } from "./chunk-Y6IB6PHW.js";
3
+ } from "./chunk-REPAOCCC.js";
4
4
  import "./chunk-MWMYEK3D.js";
5
5
  import "./chunk-2ZTPUQGS.js";
6
6
  import "./chunk-3QC7HYIF.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brillout/docpress",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "exports": {
5
5
  "./renderer/_default.page.server.js": "./dist/renderer/_default.page.server.js",
6
6
  "./renderer/_default.page.client.js": "./dist/renderer/_default.page.client.js",