@lincyaw/compiler 1.0.0-rc.111 → 1.0.0-rc.113

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/markdown.ts +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lincyaw/compiler",
3
- "version": "1.0.0-rc.111",
3
+ "version": "1.0.0-rc.113",
4
4
  "description": "Presmium's compiler: structured JSON documents to runtime IR, plugin loading, compile-time execution and its cache, checks and the renderers",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -46,7 +46,7 @@
46
46
  "semver": "^7.8.5",
47
47
  "send": "1.2.1",
48
48
  "yaml": "^2.9.1",
49
- "@lincyaw/kernel": "1.0.0-rc.111"
49
+ "@lincyaw/kernel": "1.0.0-rc.113"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/content-disposition": "^0.5.9",
package/src/markdown.ts CHANGED
@@ -165,7 +165,7 @@ export function markdownDocument(source: string, options: { id: string, title: s
165
165
  root.children = (root.children ?? []).flatMap(relink)
166
166
  restoreLabels(root)
167
167
 
168
- const used = new Set<string>([options.id])
168
+ const used = new Set<string>()
169
169
  const unique = (base: string) => {
170
170
  let id = base.slice(0, 180) || 'node'
171
171
  for (let n = 2; used.has(id); n++) id = `${base.slice(0, 180)}-${n}`
@@ -292,7 +292,7 @@ export function markdownDocument(source: string, options: { id: string, title: s
292
292
  return {
293
293
  document: {
294
294
  schemaVersion: 1,
295
- id: options.id,
295
+ id: unique(options.id),
296
296
  metadata: {
297
297
  title,
298
298
  lang: frontmatter.lang ?? options.lang ?? guessLang(body),