Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

Commit

Permalink
Merge pull request #38 from gentlementlegen/fix/escape-html
Browse files Browse the repository at this point in the history
fix: escaping ampersand and backtick characters
  • Loading branch information
gentlementlegen authored Jun 7, 2024
2 parents 1ac4959 + 8f791cb commit 6c2a91a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/handlers/issue/generate-permits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,13 @@ function generateDetailsTable(totals: TotalsById) {

const commentUrl = commentSource.comment.html_url;
const truncatedBody = commentSource
? commentSource.comment.body.replaceAll("<", "&lt;").replaceAll(">", "&gt;").substring(0, 64).concat("...")
? commentSource.comment.body
.replaceAll("&", "&amp;")
.replaceAll("<", "&lt;")
.replaceAll(">", "&gt;")
.replaceAll("`", "&#96;")
.substring(0, 64)
.concat("...")
: "";
const formatScoreDetails = commentScore.formatScoreCommentDetails;

Expand Down

0 comments on commit 6c2a91a

Please sign in to comment.