From 0590caf7a1a546090147ce42b73cb62b86297b3a Mon Sep 17 00:00:00 2001 From: Dan Gowans Date: Tue, 30 Apr 2024 10:15:13 -0400 Subject: [PATCH] fix parsing error --- samples/browserTest.js | 5 +++-- samples/browserTest.ts | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/samples/browserTest.js b/samples/browserTest.js index 17dceb6..ab23ca9 100644 --- a/samples/browserTest.js +++ b/samples/browserTest.js @@ -1,7 +1,8 @@ document.getElementById('#test').innerHTML = document.getElementsByClassName('input')[0].value; document.getElementById('#test').innerHTML = cityssm.escapeHTML(document.getElementsByClassName('input')[0].value); document.getElementById('#test').innerHTML = `

-${cityssm.escapeHTML(document.getElementsByClassName('input')[0].value)} +${cityssm.escapeHTML(document.getElementsByClassName('input')[0].value)})}

`; -var text = document.getElementsByTagName('p')[2].textContent; +var text = document.getElementsByTagName('p')[2].textContent ?? ''; document.getElementById('#test').insertAdjacentHTML('beforeend', text); +document.getElementById('#test').insertAdjacentHTML('beforeend', cityssm.escapeHTML(text)); diff --git a/samples/browserTest.ts b/samples/browserTest.ts index 2f80f64..9105ba2 100644 --- a/samples/browserTest.ts +++ b/samples/browserTest.ts @@ -4,9 +4,11 @@ document.getElementById('#test')!.innerHTML = document.getElementsByClassName('i document.getElementById('#test')!.innerHTML = `

-${cityssm.escapeHTML(document.getElementsByClassName('input')[0].value})} +${cityssm.escapeHTML(document.getElementsByClassName('input')[0].value)})}

` -var text = document.getElementsByTagName('p')[2].textContent +var text = document.getElementsByTagName('p')[2].textContent ?? '' -document.getElementById('#test')!.insertAdjacentHTML('beforeend', text) \ No newline at end of file +document.getElementById('#test')!.insertAdjacentHTML('beforeend', text) + +document.getElementById('#test')!.insertAdjacentHTML('beforeend', cityssm.escapeHTML(text)) \ No newline at end of file