Skip to content

Commit

Permalink
Merge pull request #188 from docsbydoxdox/hotfix/encode-html-tags-in-…
Browse files Browse the repository at this point in the history
…renderers

[hotfix] Encode HTML tags in renderers.
  • Loading branch information
neogeek authored Sep 9, 2022
2 parents 15ce144 + 97973d1 commit 628b862
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
4 changes: 4 additions & 0 deletions packages/doxdox-renderer-bootstrap/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ ${md
...method.params.map(({ name, types, description }) => [
name,
`<code>${types
.map(type =>
type.replace(/</, '&lt;').replace(/>/, '&gt;')
)
.map(type => mdTypes.renderInline(type))
.join('</code>, <code>')}</code>`,
description || ''
Expand All @@ -65,6 +68,7 @@ ${
${method.returns.map(
param => `<p><code>${param.types
.map(type => type.replace(/</, '&lt;').replace(/>/, '&gt;'))
.map(type => mdTypes.renderInline(type))
.join('</code>, <code>')}</code></p>
Expand Down
2 changes: 2 additions & 0 deletions packages/doxdox-renderer-dash/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ ${md
...method.params.map(({ name, types, description }) => [
name,
`<code>${types
.map(type => type.replace(/</, '&lt;').replace(/>/, '&gt;'))
.map(type => mdTypes.renderInline(type))
.join('</code>, <code>')}</code>`,
description || ''
Expand All @@ -85,6 +86,7 @@ ${
${method.returns.map(
param => `<p><code>${param.types
.map(type => type.replace(/</, '&lt;').replace(/>/, '&gt;'))
.map(type => mdTypes.renderInline(type))
.join('</code>, <code>')}</code></p>
Expand Down
8 changes: 6 additions & 2 deletions packages/doxdox-renderer-github-wiki/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ ${markdownTable([
['Name', 'Types', 'Description'],
...method.params.map(({ name, types, description }) => [
name,
types.join(', '),
types
.map(type => type.replace(/</, '&lt;').replace(/>/, '&gt;'))
.join(', '),
description || ''
])
])}`
Expand All @@ -34,7 +36,9 @@ ${
? `### Returns
${method.returns.map(
param => `${param.types.join(', ')}
param => `${param.types
.map(type => type.replace(/</, '&lt;').replace(/>/, '&gt;'))
.join(', ')}
${param.description || ''}`
)}`
: ''
Expand Down
8 changes: 6 additions & 2 deletions packages/doxdox-renderer-markdown/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ ${markdownTable([
['Name', 'Types', 'Description'],
...method.params.map(({ name, types, description }) => [
name,
types.join(', '),
types
.map(type => type.replace(/</, '&lt;').replace(/>/, '&gt;'))
.join(', '),
description || ''
])
])}`
Expand All @@ -28,7 +30,9 @@ ${
? `### Returns
${method.returns.map(
param => `${param.types.join(', ')}
param => `${param.types
.map(type => type.replace(/</, '&lt;').replace(/>/, '&gt;'))
.join(', ')}
${param.description || ''}`
)}`
: ''
Expand Down
2 changes: 2 additions & 0 deletions packages/doxdox-renderer-pdf/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ ${md
...method.params.map(({ name, types, description }) => [
name,
`<code>${types
.map(type => type.replace(/</, '&lt;').replace(/>/, '&gt;'))
.map(type => mdTypes.renderInline(type))
.join('</code>, <code>')}</code>`,
description || ''
Expand All @@ -59,6 +60,7 @@ ${
${method.returns.map(
param => `<p><code>${param.types
.map(type => type.replace(/</, '&lt;').replace(/>/, '&gt;'))
.map(type => mdTypes.renderInline(type))
.join('</code>, <code>')}</code></p>
Expand Down

0 comments on commit 628b862

Please sign in to comment.