Skip to content

Commit

Permalink
Merge pull request #325 from campersau/escape_header
Browse files Browse the repository at this point in the history
escape diff headers for html
  • Loading branch information
rtfpessoa authored Jun 30, 2020
2 parents 12bf306 + 406be9f commit 8462e52
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/__tests__/diff2html-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ describe('Diff2Html', () => {
<tr>
<td class=\\"d2h-code-linenumber d2h-info\\"></td>
<td class=\\"d2h-info\\">
<div class=\\"d2h-code-line d2h-info\\">@@ -11,7 +10,7 @@ $a=&quot;&lt;table&gt;&lt;tr&gt;&lt;td&gt;- 1.1.9: Fix around ubuntu&#x27;s inability to cache promises. [#8</div>
<div class=\\"d2h-code-line d2h-info\\">@@ -11,7 +10,7 @@ $a=&amp;quot;&amp;lt;table&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;- 1.1.9: Fix around ubuntu&amp;#x27;s inability to cache promises. [#8</div>
</td>
</tr><tr>
<td class=\\"d2h-code-linenumber d2h-cntx\\">
Expand Down
2 changes: 1 addition & 1 deletion src/line-by-line-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export default class LineByLineRenderer {
.map(block => {
let lines = this.hoganUtils.render(genericTemplatesPath, 'block-header', {
CSSLineClass: renderUtils.CSSLineClass,
blockHeader: block.header,
blockHeader: renderUtils.escapeForHtml(block.header),
lineClass: 'd2h-code-linenumber',
contentClass: 'd2h-code-line',
});
Expand Down
2 changes: 1 addition & 1 deletion src/side-by-side-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export default class SideBySideRenderer {
makeHeaderHtml(blockHeader: string): string {
return this.hoganUtils.render(genericTemplatesPath, 'block-header', {
CSSLineClass: renderUtils.CSSLineClass,
blockHeader: blockHeader,
blockHeader: renderUtils.escapeForHtml(blockHeader),
lineClass: 'd2h-code-side-linenumber',
contentClass: 'd2h-code-side-line',
});
Expand Down

0 comments on commit 8462e52

Please sign in to comment.