@adobe/jsonschema2md 8.1.0 → 8.1.2

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ ## [8.1.2](https://github.com/adobe/jsonschema2md/compare/v8.1.1...v8.1.2) (2026-12-04)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * preserve generated page slugs when resolving references again ([846c388](https://github.com/adobe/jsonschema2md/commit/846c388d4afc5e1d470c2dd81a28ed5370eac331)), closes [#680](https://github.com/adobe/jsonschema2md/issues/680)
7
+
8
+ ## [8.1.1](https://github.com/adobe/jsonschema2md/compare/v8.1.0...v8.1.1) (2026-12-04)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **markdownBuilder:** keep trailing newlines of YAML block scalars ([202e5de](https://github.com/adobe/jsonschema2md/commit/202e5dec5acdf717fff9a7eb68d5a54080f4232d)), closes [#789](https://github.com/adobe/jsonschema2md/issues/789)
14
+ * **markdownBuilder:** remove trailing blank line from YAML examples ([e18db78](https://github.com/adobe/jsonschema2md/commit/e18db7841563abcd4063646b480173d28bb666ae)), closes [#247](https://github.com/adobe/jsonschema2md/issues/247)
15
+
1
16
  # [8.1.0](https://github.com/adobe/jsonschema2md/compare/v8.0.11...v8.1.0) (2026-12-04)
2
17
 
3
18
 
@@ -720,7 +720,8 @@ export default function build({
720
720
  if (schema[keyword`examples`] && schema[keyword`examples`].length > 0 && exampleFormat === 'yaml') {
721
721
  return [
722
722
  heading(level + 1, text(i18n`${simpletitle(schema)} Examples`)),
723
- ...schema[keyword`examples`].map((example) => paragraph(code('yaml', yaml.dump(example, undefined, 2)))),
723
+ // only drop the final newline: more would change `|+` block scalars
724
+ ...schema[keyword`examples`].map((example) => paragraph(code('yaml', yaml.dump(example, undefined, 2).replace(/\n$/, '')))),
724
725
  ];
725
726
  }
726
727
  if (schema[keyword`examples`] && schema[keyword`examples`].length > 0 && exampleFormat === 'json') {
@@ -152,10 +152,14 @@ const handler = ({
152
152
 
153
153
  if (referenced !== null) {
154
154
  // inject the referenced schema into the current schema
155
+ const slug = retval[myslug];
155
156
  Object.assign(retval, referenced);
156
157
  if (referenced && referenced[keyword`$id`]) {
157
158
  // Traversal deduplicates schema IDs, so reuse the referenced page's slug.
158
159
  retval[myslug] = referenced[symbols.slug];
160
+ } else if (slug !== undefined) {
161
+ // Earlier links may already use this page's slug; resolving again must not change it.
162
+ retval[myslug] = slug;
159
163
  }
160
164
  } else {
161
165
  console.error('cannot resolve', basedoc);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@adobe/jsonschema2md",
3
3
  "description": "Validate and document complex JSON Schemas the easy way.",
4
- "version": "8.1.0",
4
+ "version": "8.1.2",
5
5
  "main": "lib/index.js",
6
6
  "typings": "types",
7
7
  "bin": {