@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 +15 -0
- package/lib/markdownBuilder.js +2 -1
- package/lib/schemaProxy.js +4 -0
- package/package.json +1 -1
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
|
|
package/lib/markdownBuilder.js
CHANGED
|
@@ -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
|
-
|
|
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') {
|
package/lib/schemaProxy.js
CHANGED
|
@@ -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);
|