Skip to content

Commit

Permalink
fix parsing error
Browse files Browse the repository at this point in the history
  • Loading branch information
dangowans committed Apr 30, 2024
1 parent 2fd1b74 commit 0590caf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions samples/browserTest.js
Original file line number Diff line number Diff line change
@@ -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 = `<p>
${cityssm.escapeHTML(document.getElementsByClassName('input')[0].value)}
${cityssm.escapeHTML(document.getElementsByClassName('input')[0].value)})}
</p>`;
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));
8 changes: 5 additions & 3 deletions samples/browserTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ document.getElementById('#test')!.innerHTML = document.getElementsByClassName('i


Check failure on line 5 in samples/browserTest.ts

View workflow job for this annotation

GitHub Actions / Node 20

More than 1 blank line not allowed

Check failure on line 5 in samples/browserTest.ts

View workflow job for this annotation

GitHub Actions / Node 18

More than 1 blank line not allowed

Check failure on line 5 in samples/browserTest.ts

View workflow job for this annotation

GitHub Actions / Node 21

More than 1 blank line not allowed
document.getElementById('#test')!.innerHTML = `<p>

Check warning on line 6 in samples/browserTest.ts

View workflow job for this annotation

GitHub Actions / Node 20

Forbidden non-null assertion

Check failure on line 6 in samples/browserTest.ts

View workflow job for this annotation

GitHub Actions / Node 20

Prefer `.querySelector()` over `.getElementById()`

Check warning on line 6 in samples/browserTest.ts

View workflow job for this annotation

GitHub Actions / Node 18

Forbidden non-null assertion

Check failure on line 6 in samples/browserTest.ts

View workflow job for this annotation

GitHub Actions / Node 18

Prefer `.querySelector()` over `.getElementById()`

Check warning on line 6 in samples/browserTest.ts

View workflow job for this annotation

GitHub Actions / Node 21

Forbidden non-null assertion

Check failure on line 6 in samples/browserTest.ts

View workflow job for this annotation

GitHub Actions / Node 21

Prefer `.querySelector()` over `.getElementById()`
${cityssm.escapeHTML(document.getElementsByClassName('input')[0].value})}
${cityssm.escapeHTML(document.getElementsByClassName('input')[0].value)})}

Check failure on line 7 in samples/browserTest.ts

View workflow job for this annotation

GitHub Actions / Node 20

Prefer `.querySelectorAll()` over `.getElementsByClassName()`

Check failure on line 7 in samples/browserTest.ts

View workflow job for this annotation

GitHub Actions / Node 18

Prefer `.querySelectorAll()` over `.getElementsByClassName()`

Check failure on line 7 in samples/browserTest.ts

View workflow job for this annotation

GitHub Actions / Node 21

Prefer `.querySelectorAll()` over `.getElementsByClassName()`
</p>`

var text = document.getElementsByTagName('p')[2].textContent
var text = document.getElementsByTagName('p')[2].textContent ?? ''

Check failure on line 10 in samples/browserTest.ts

View workflow job for this annotation

GitHub Actions / Node 20

Unexpected var, use let or const instead

Check failure on line 10 in samples/browserTest.ts

View workflow job for this annotation

GitHub Actions / Node 18

Unexpected var, use let or const instead

Check failure on line 10 in samples/browserTest.ts

View workflow job for this annotation

GitHub Actions / Node 21

Unexpected var, use let or const instead

document.getElementById('#test')!.insertAdjacentHTML('beforeend', text)
document.getElementById('#test')!.insertAdjacentHTML('beforeend', text)

Check warning on line 12 in samples/browserTest.ts

View workflow job for this annotation

GitHub Actions / Node 20

Forbidden non-null assertion

Check warning on line 12 in samples/browserTest.ts

View workflow job for this annotation

GitHub Actions / Node 18

Forbidden non-null assertion

Check warning on line 12 in samples/browserTest.ts

View workflow job for this annotation

GitHub Actions / Node 21

Forbidden non-null assertion

document.getElementById('#test')!.insertAdjacentHTML('beforeend', cityssm.escapeHTML(text))

Check warning on line 14 in samples/browserTest.ts

View workflow job for this annotation

GitHub Actions / Node 20

Forbidden non-null assertion

Check warning on line 14 in samples/browserTest.ts

View workflow job for this annotation

GitHub Actions / Node 18

Forbidden non-null assertion

Check warning on line 14 in samples/browserTest.ts

View workflow job for this annotation

GitHub Actions / Node 21

Forbidden non-null assertion

0 comments on commit 0590caf

Please sign in to comment.