Skip to content
This repository was archived by the owner on May 3, 2024. It is now read-only.

Commit ea62374

Browse files
committed
Added Handlebars helper replaceNewLinesWithBR to fix issue with table cell rendering.
1 parent cdf6045 commit ea62374

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

helpers.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const Handlebars = require('handlebars');
2+
3+
Handlebars.registerHelper('replaceNewLinesWithBR', block => block.replace(/[\r\n]+/g, '<br>'));

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ const path = require('path');
33

44
const Handlebars = require('handlebars');
55

6+
require('./helpers');
7+
68
const admzip = require('adm-zip');
79

810
/**

template.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
| Name | Type | Description | |
1212
| ---- | ---- | ----------- | -------- |
1313
{{#each tags.param}}
14-
| {{name}} | {{#each types}}`{{.}}` {{/each}} | {{{description}}} | {{#if isOptional}}*Optional*{{else}}&nbsp;{{/if}} |
14+
| {{name}} | {{#each types}}`{{{.}}}` {{/each}} | {{{replaceNewLinesWithBR description}}} | {{#if isOptional}}*Optional*{{else}}&nbsp;{{/if}} |
1515
{{/each}}
1616

1717
{{/if}}
@@ -23,7 +23,7 @@
2323
| Name | Type | Description | |
2424
| ---- | ---- | ----------- | -------- |
2525
{{#each tags.param}}
26-
| {{name}} | {{#each types}}`{{.}}` {{/each}} | {{{description}}} | {{#if isOptional}}*Optional*{{else}}&nbsp;{{/if}} |
26+
| {{name}} | {{#each types}}`{{{.}}}` {{/each}} | {{{replaceNewLinesWithBR description}}} | {{#if isOptional}}*Optional*{{else}}&nbsp;{{/if}} |
2727
{{/each}}
2828

2929
{{/if}}

0 commit comments

Comments
 (0)