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

Commit 783cba3

Browse files
authored
Merge pull request #22 from neogeek/hotfix/table-cell-newline-fix
Added Handlebars helper to fix issue with table cell rendering.
2 parents 32cc03e + d893cd6 commit 783cba3

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
/**
79
* Markdown template plugin for doxdox.
810
*

template.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
| Name | Type | Description | |
2828
| ---- | ---- | ----------- | -------- |
2929
{{#each tags.param}}
30-
| {{name}} | {{#each types}}`{{.}}` {{/each}} | {{{description}}} | {{#if isOptional}}*Optional*{{else}}&nbsp;{{/if}} |
30+
| {{name}} | {{#each types}}`{{{.}}}` {{/each}} | {{{replaceNewLinesWithBR description}}} | {{#if isOptional}}*Optional*{{else}}&nbsp;{{/if}} |
3131
{{/each}}
3232

3333
{{/if}}
@@ -39,7 +39,7 @@
3939
| Name | Type | Description | |
4040
| ---- | ---- | ----------- | -------- |
4141
{{#each tags.param}}
42-
| {{name}} | {{#each types}}`{{.}}` {{/each}} | {{{description}}} | {{#if isOptional}}*Optional*{{else}}&nbsp;{{/if}} |
42+
| {{name}} | {{#each types}}`{{{.}}}` {{/each}} | {{{replaceNewLinesWithBR description}}} | {{#if isOptional}}*Optional*{{else}}&nbsp;{{/if}} |
4343
{{/each}}
4444

4545
{{/if}}

0 commit comments

Comments
 (0)