calc: escape cipher names at all render sinks (parity with production; interim, CSP-real is the durable fix)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LmGTn96JVn6xPNNTTW77g1
This commit is contained in:
malonehunterandClaude Opus 4.8 committed 2026-09-14 05:49:52 -04:00
1 parent b478d1122c
commit 0396c39b77
5 files changed
+18 -18

No files matched your search

+6 -6
View File
@@ -82,7 +82,7 @@ function updateWordBreakdown(impName = breakCipher, impBool = false, chartUpd =
}
oStart += '<div id="SimpleBreak">'
oStart += '<span class="breakPhrase">' + escHtml(simplePhr) + '</span><span class="breakPhrase"> = </span><span class="breakSum">' + curCipher.sumArr.reduce(getSum) + ' </span>' // add all values in array
oStart += '<span class="breakCipher"><font style="'+curCiphCol+'"> (' + curCipher.cipherName + gemCalcModeLabel(curCipher) + ')</font></span>'
oStart += '<span class="breakCipher"><font style="'+curCiphCol+'"> (' + escHtml(curCipher.cipherName) + gemCalcModeLabel(curCipher) + ')</font></span>'
}
if (optWordBreakdown == true && curCipher.cp.length <= chLimit ) { // character limit, calculated even if out of screen bounds
@@ -141,7 +141,7 @@ function updateWordBreakdown(impName = breakCipher, impBool = false, chartUpd =
}
}
ciphEndClass = (leftToRightBreak) ? "CipherEnd" : "CipherEndRTL"
if (optCompactBreakdown == true) o += '</tr><tr><td colspan=' + tdCount + ' class="'+ciphEndClass+'"><font style="'+curCiphCol+'">' + curCipher.cipherName + gemCalcModeLabel(curCipher) + '</font></td></tr></table></div>'
if (optCompactBreakdown == true) o += '</tr><tr><td colspan=' + tdCount + ' class="'+ciphEndClass+'"><font style="'+curCiphCol+'">' + escHtml(curCipher.cipherName) + gemCalcModeLabel(curCipher) + '</font></td></tr></table></div>'
else o += '</tr></tbody></table></div>'
o = oStart + o // prepend phrase, word/letter count
@@ -227,7 +227,7 @@ function updateWordBreakdown(impName = breakCipher, impBool = false, chartUpd =
o = oStart + o // prepend phrase, word/letter count
if (optCompactBreakdown == true) {
o += '<div id="BreakSumLong"><span class="breakSumDark">' + curCipher.sumArr.reduce(getSum) + ' </span>'
o += '<span class="breakCipher" style="'+curCiphCol+'">' + curCipher.cipherName + gemCalcModeLabel(curCipher) + '</span></div></div>'
o += '<span class="breakCipher" style="'+curCiphCol+'">' + escHtml(curCipher.cipherName) + gemCalcModeLabel(curCipher) + '</span></div></div>'
} else {
o += '<div style="padding: 0.5em"></div>'
}
@@ -249,7 +249,7 @@ function updateWordBreakdown(impName = breakCipher, impBool = false, chartUpd =
if (curCipher.cp.length > chLimit) chartClass = 'SimpleBreakChartLong'
o = '<tr><td colspan=' + tdCount + '>'
o += '<div class="'+chartClass+'"><span class="breakPhraseChart">' + escHtml(simplePhr) + ' = ' + curCipher.sumArr.reduce(getSum) + ' </span>' // add all values in array
o += '<span class="breakPhraseChartCiphName" style="'+curCiphCol+'">(' + curCipher.cipherName + gemCalcModeLabel(curCipher) + ')</span></div></td></tr>'
o += '<span class="breakPhraseChartCiphName" style="'+curCiphCol+'">(' + escHtml(curCipher.cipherName) + gemCalcModeLabel(curCipher) + ')</span></div></td></tr>'
$('#BreakTableContainer').prepend(o) // insert in the beginning of the table
}
@@ -322,7 +322,7 @@ function updateCipherChart(curCipher) {
o += '<tr>'
o += '<td id="spaceChartBtn" style="font-size: 150%; font-weight: 500; '+curCiphFaintCol+'">-</td>' // Space
o += '<td id="capsNameChartBtn" colspan="' + (Math.ceil(curCipher.cArr.length / 2) - 2) + '">'
o += '<font style="font-size: 150%; font-weight: 500; '+curCiphCol+'">' + curCipher.cipherName + '</font>'
o += '<font style="font-size: 150%; font-weight: 500; '+curCiphCol+'">' + escHtml(curCipher.cipherName) + '</font>'
o += '</td>'
o += '<td id="backspaceChartBtn" style="font-size: 150%; font-weight: 500; '+curCiphFaintCol+'">&#8592;</td>' // Backspace
o += '</tr><tr>'
@@ -376,7 +376,7 @@ function updateCipherChartGemCard(impName = breakCipher) {
o += '<tbody><tr>'
o += '<td colspan="' + curCipher.cArr.length + '">'
o += '<font style="font-size: 150%; font-weight: 500; '+curCiphCol+'">' + curCipher.cipherName + '</font>'
o += '<font style="font-size: 150%; font-weight: 500; '+curCiphCol+'">' + escHtml(curCipher.cipherName) + '</font>'
o += '</td></tr><tr>'
var halfL = curCipher.cArr.length / 2
+6 -6
View File
@@ -443,7 +443,7 @@ function displayCipherCatDetailed(curCat) {
} // checkbox state
o +=
'<tr><td><label class="chkLabel ciphCheckboxLabel2">' +
cipherList[i].cipherName +
escHtml(cipherList[i].cipherName) +
'<input type="checkbox" id="cipher_chkbox' +
i +
'" onclick="toggleCipher(' +
@@ -1077,7 +1077,7 @@ function toggleColorControlsMenu(redraw = false) {
if (cipherList[i].enabled) {
o +=
'<td><span class="ciphCheckboxLabel">' +
cipherList[i].cipherName +
escHtml(cipherList[i].cipherName) +
"</span></td>";
o +=
'<td><input type="number" step="2" min="-360" max="360" value="' +
@@ -1965,7 +1965,7 @@ function updateEnabledCipherTable() {
'<td class="phraseGemCiphName" style="' +
cur_col +
'">' +
cipherList[i].cipherName +
escHtml(cipherList[i].cipherName) +
"</td>";
// o += '<td class="phraseGemValueOdd" style="'+cur_col+'">'+cipherList[i].calcGematria(phr)+'</td>'
o +=
@@ -1990,7 +1990,7 @@ function updateEnabledCipherTable() {
'<td class="phraseGemCiphName" style="' +
cur_col +
'">' +
cipherList[i].cipherName +
escHtml(cipherList[i].cipherName) +
"</td>";
ciph_in_row++;
odd_col = true;
@@ -2231,7 +2231,7 @@ function updateHistoryTable(hltBoolArr) {
'px;"><span class="hCV2" style="' +
curCiphCol +
'">' +
cipherList[z].cipherName +
escHtml(cipherList[z].cipherName) +
"</span></td>"; // color of cipher displayed in the table
} else {
ms +=
@@ -2242,7 +2242,7 @@ function updateHistoryTable(hltBoolArr) {
"px; min-width: " +
calcCipherNameWidthPx(cipherList[z].cipherName) +
'px;">' +
cipherList[z].cipherName +
escHtml(cipherList[z].cipherName) +
"</td>"; // color of cipher displayed in the table
}
}
+1 -1
View File
@@ -283,7 +283,7 @@ function updateDatabaseQueryTable(stPos = 0, dItems, scrollBarEvent = false) { /
curCiphCol = (optColoredCiphers) ? 'hsl('+curCiph.H+' '+curCiph.S+'% '+curCiph.L+'% / 1)' : ''
// ms += '<td class="hCVQ"><span class="hCV2" style="color: '+curCiphCol+'">'+curCiph.cipherName.replace(/ /g, "<br>")+'</span></td>' // color of cipher displayed in the table
ms += '<td class="hCVQ" style="height: '+calcCipherNameHeightPx(curCiph.cipherName)+'px;"><span class="hCV2" style="color: '+curCiphCol+'">'
ms += curCiph.cipherName+'</span></td>' // color of cipher displayed in the table
ms += escHtml(curCiph.cipherName)+'</span></td>' // color of cipher displayed in the table
}
ms += "</tr>"
curPos += dbPageItems
+1 -1
View File
@@ -44,7 +44,7 @@ function toggleEncodingMenu(updateEncMenu = false, clearValues = false) {
if (cipherList[i].enabled == true) { // for each enabled cipher
chkVal = (document.getElementById('encCiphVal'+i) !== null) ? document.getElementById('encCiphVal'+i).value : 0
chkVal = (clearValues) ? 0 : chkVal // clear values
o += '<td><span class="ciphCheckboxLabel">'+cipherList[i].cipherName+'</span></td>'
o += '<td><span class="ciphCheckboxLabel">'+escHtml(cipherList[i].cipherName)+'</span></td>'
o += '<td><input type="text" value="'+chkVal+'" class="colSlider" id="encCiphVal'+i+'"></td>'
o += '<td style="min-width: 16px;"></td>'
ciph_in_row++
+4 -4
View File
@@ -16,7 +16,7 @@
<!-- html2canvas v1.0.0-alpha.12 -->
<script src="calc/gematria.js?v=3"></script>
<script src="calc/calc.js?v=16"></script>
<script src="calc/calc.js?v=17"></script>
<script src="calc/init-variables.js?v=8"></script>
<script src="calc/ciphers.js?v=6"></script>
@@ -146,7 +146,7 @@
<span id="loadPanel"></span>
<script src="calc/breakdown.js?v=3"></script>
<script src="calc/breakdown.js?v=4"></script>
<script src="calc/highlighter.js?v=3"></script>
<script src="calc/export.js?v=3"></script>
@@ -154,11 +154,11 @@
<script src="calc/num-prop.js?v=2"></script>
<script src="calc/edit-ciphers.js?v=2"></script>
<script src="calc/date-calc.js?v=2"></script>
<script src="calc/database.js?v=8"></script>
<script src="calc/database.js?v=9"></script>
<script src="calc/quick-guide.js?v=2"></script>
<script src="calc/localstorage.js?v=3"></script>
<script src="calc/encoding.js?v=2"></script>
<script src="calc/encoding.js?v=3"></script>
<script src="calc/encoding-ciphers.js?v=2"></script>
<script src="calc/coderain.js?v=2"></script>