Skip to content

Commit 25f213c

Browse files
Copilotgithub-actions[bot]aaronpowell
authored
Fix double-unescaping in decodeEntities (CodeQL alert #32) (#1757)
* chore: publish from staged * Initial plan * Fix double-unescaping in decodeEntities (alert #32) Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
1 parent 05bd473 commit 25f213c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

skills/md-to-docx/scripts/md-to-docx.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ const tableBorders = {
9393
// --- Utility: decode HTML entities ---
9494
function decodeEntities(str) {
9595
return str
96-
.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">")
97-
.replace(/&quot;/g, '"').replace(/&#39;/g, "'");
96+
.replace(/&lt;/g, "<").replace(/&gt;/g, ">")
97+
.replace(/&quot;/g, '"').replace(/&#39;/g, "'")
98+
.replace(/&amp;/g, "&");
9899
}
99100

100101
// --- Inline tokens to TextRun[] ---

0 commit comments

Comments
 (0)