diff --git a/calm-plugins/vscode/package.json b/calm-plugins/vscode/package.json index 15c240efa..7fc68c5ef 100644 --- a/calm-plugins/vscode/package.json +++ b/calm-plugins/vscode/package.json @@ -2,7 +2,7 @@ "name": "calm-vscode-plugin", "displayName": "CALM", "description": "Live-visualize CALM architecture models, validate, and generate docs.", - "version": "0.4.1", + "version": "0.4.2", "publisher": "FINOS", "homepage": "https://calm.finos.org", "repository": { diff --git a/calm-widgets/src/widgets.e2e.spec.ts b/calm-widgets/src/widgets.e2e.spec.ts index 5113babf7..662ad9ed6 100644 --- a/calm-widgets/src/widgets.e2e.spec.ts +++ b/calm-widgets/src/widgets.e2e.spec.ts @@ -96,6 +96,15 @@ describe('Widgets E2E - Handlebars Integration', () => { expectToBeSameIgnoringLineEndings(result, expected); }); + + it('renders primitive arrays inline with comma separator (MDX-safe)', () => { + const { context, template, expected } = fixtures.loadFixture('table-widget', 'metadata-primitive-array'); + + const compiledTemplate = handlebars.compile(template); + const result = compiledTemplate(context); + + expectToBeSameIgnoringLineEndings(result, expected); + }); }); describe('List Widget', () => { diff --git a/calm-widgets/src/widgets/table/row-template.html b/calm-widgets/src/widgets/table/row-template.html index 539d1bf34..1de90e9be 100644 --- a/calm-widgets/src/widgets/table/row-template.html +++ b/calm-widgets/src/widgets/table/row-template.html @@ -18,7 +18,7 @@ {{> table-template.html rows=(objectEntries this) headers=false flatTable=false hasRows=true isNested=true}} {{else}} - {{this}} + {{this}}{{#unless @last}}, {{/unless}} {{/if}} {{/each}} {{else}} diff --git a/calm-widgets/src/widgets/table/table-vertical.html b/calm-widgets/src/widgets/table/table-vertical.html index 7c994ec75..bf08188c5 100644 --- a/calm-widgets/src/widgets/table/table-vertical.html +++ b/calm-widgets/src/widgets/table/table-vertical.html @@ -18,8 +18,7 @@ {{> table-template.html rows=(objectEntries cellValue) headers=false flatTable=false hasRows=true isNested=true}} {{else if (isArray cellValue)}}{{#each cellValue}}{{#if (isObject this)}} {{> table-template.html rows=(objectEntries this) headers=false flatTable=false hasRows=true isNested=true}} - {{else}}{{this}} - {{/if}}{{/each}}{{else}}{{cellValue}}{{/if}} + {{else}}{{this}}{{#unless @last}}, {{/unless}}{{/if}}{{/each}}{{else}}{{cellValue}}{{/if}} {{/with}} {{/with}} diff --git a/calm-widgets/test-fixtures/combined-widgets/comprehensive-documentation/expected.md b/calm-widgets/test-fixtures/combined-widgets/comprehensive-documentation/expected.md index 6eaca420d..2b89cb862 100644 --- a/calm-widgets/test-fixtures/combined-widgets/comprehensive-documentation/expected.md +++ b/calm-widgets/test-fixtures/combined-widgets/comprehensive-documentation/expected.md @@ -184,8 +184,8 @@
| Key | +Value | +
|---|---|
| Operations | +add, subtract, multiply, divide | +
| Tags | +payment, financial, api | +
| Version | +1.0.0 | +