diff --git a/rollup.config.js b/rollup.config.js index 60545d7c..4e97a3de 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -32,7 +32,7 @@ const handlebarsPlugin = () => ({ preventIndent: true, knownHelpersOnly: true, knownHelpers: { - escapeQuotes: true, + escapeSinglequotes: true, equals: true, notEquals: true, containsSpaces: true, diff --git a/src/templates/partials/schemaComposition.hbs b/src/templates/partials/schemaComposition.hbs index 005ea046..1cceecf0 100644 --- a/src/templates/partials/schemaComposition.hbs +++ b/src/templates/partials/schemaComposition.hbs @@ -1,7 +1,7 @@ { type: '{{export}}', {{#if description}} - description: '{{{escapeQuotes description}}}', + description: '{{{escapeSinglequotes description}}}', {{/if}} contains: [{{#each properties}}{{>schema}}{{#unless @last}}, {{/unless}}{{/each}}], {{#if isReadOnly}} diff --git a/src/templates/partials/schemaGeneric.hbs b/src/templates/partials/schemaGeneric.hbs index d41956a8..ec964dd4 100644 --- a/src/templates/partials/schemaGeneric.hbs +++ b/src/templates/partials/schemaGeneric.hbs @@ -3,7 +3,7 @@ type: '{{{base}}}', {{/if}} {{#if description}} - description: '{{{escapeQuotes description}}}', + description: '{{{escapeSinglequotes description}}}', {{/if}} {{#if isReadOnly}} isReadOnly: {{{isReadOnly}}}, diff --git a/src/templates/partials/schemaInterface.hbs b/src/templates/partials/schemaInterface.hbs index 0488adae..65fd3316 100644 --- a/src/templates/partials/schemaInterface.hbs +++ b/src/templates/partials/schemaInterface.hbs @@ -1,6 +1,6 @@ { {{#if description}} - description: '{{{escapeQuotes description}}}', + description: '{{{escapeSinglequotes description}}}', {{/if}} properties: { {{#if properties}} diff --git a/src/utils/registerHandlebarHelpers.ts b/src/utils/registerHandlebarHelpers.ts index 99c5dca2..bea65337 100644 --- a/src/utils/registerHandlebarHelpers.ts +++ b/src/utils/registerHandlebarHelpers.ts @@ -11,7 +11,7 @@ export function registerHandlebarHelpers(root: { useUnionTypes: boolean; }): void { Handlebars.registerHelper('escapeQuotes', function (value: string): string { - return value.replace(/(['"])/g, '\\$1'); + return value.replace(/(')/g, '\\$1'); }); Handlebars.registerHelper(