SeasideSt / Seaside

The framework for developing sophisticated web applications in Smalltalk.
MIT License
519 stars 71 forks source link

Re-introduce escaping of a closing tag when encoding javascript #1380

Closed jbrichau closed 1 year ago

jbrichau commented 1 year ago

Fixes #1379

Rinzwind commented 1 year ago

There’s a note in section ‘4.12.1.3 Restrictions for contents of script elements’ in the HTML Living Standard which recommends escaping <!-- and <script as well. The following snippet is based on the example in the section, the page does not show ‘Test Paragraph’ as would be expected:

FileLocator imageDirectory / 'Test.html' writeStreamDo: [ :stream |
   WAHtmlCanvas builder fullDocument: true;
      render: [ :html |
         html
            script: (html logger log: '<!-- <script>');
            paragraph: 'Test Paragraph' ]
      on: stream ]
jbrichau commented 1 year ago

@Rinzwind Good point. I moved your comment to the issue tracker since it requires a bit more work than to re-introduce the default escaping of all closing tags. To fix the issue, that should suffice but I consider it a temporary fix while we work on following that advice in the link.

codecov[bot] commented 1 year ago

Codecov Report

All modified lines are covered by tests :white_check_mark:

Comparison is base (b2d5425) 48.67% compared to head (fe070af) 48.67%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1380 +/- ## ======================================= Coverage 48.67% 48.67% ======================================= Files 8946 8948 +2 Lines 80490 80512 +22 ======================================= + Hits 39178 39192 +14 - Misses 41312 41320 +8 ``` | [Files](https://app.codecov.io/gh/SeasideSt/Seaside/pull/1380?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=SeasideSt) | Coverage Δ | | |---|---|---| | [...package/JQueryClassTest.class/instance/testHtml.st](https://app.codecov.io/gh/SeasideSt/Seaside/pull/1380?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=SeasideSt#diff-cmVwb3NpdG9yeS9KUXVlcnktVGVzdHMtQ29yZS5wYWNrYWdlL0pRdWVyeUNsYXNzVGVzdC5jbGFzcy9pbnN0YW5jZS90ZXN0SHRtbC5zdA==) | `100.00% <100.00%> (ø)` | | | [...ge/JQueryClassTest.class/instance/testWithBlock.st](https://app.codecov.io/gh/SeasideSt/Seaside/pull/1380?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=SeasideSt#diff-cmVwb3NpdG9yeS9KUXVlcnktVGVzdHMtQ29yZS5wYWNrYWdlL0pRdWVyeUNsYXNzVGVzdC5jbGFzcy9pbnN0YW5jZS90ZXN0V2l0aEJsb2NrLnN0) | `100.00% <100.00%> (ø)` | | | [...age/JQueryInstanceTest.class/instance/testAfter.st](https://app.codecov.io/gh/SeasideSt/Seaside/pull/1380?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=SeasideSt#diff-cmVwb3NpdG9yeS9KUXVlcnktVGVzdHMtQ29yZS5wYWNrYWdlL0pRdWVyeUluc3RhbmNlVGVzdC5jbGFzcy9pbnN0YW5jZS90ZXN0QWZ0ZXIuc3Q=) | `100.00% <100.00%> (ø)` | | | [...ge/JQueryInstanceTest.class/instance/testAppend.st](https://app.codecov.io/gh/SeasideSt/Seaside/pull/1380?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=SeasideSt#diff-cmVwb3NpdG9yeS9KUXVlcnktVGVzdHMtQ29yZS5wYWNrYWdlL0pRdWVyeUluc3RhbmNlVGVzdC5jbGFzcy9pbnN0YW5jZS90ZXN0QXBwZW5kLnN0) | `100.00% <100.00%> (ø)` | | | [...ge/JQueryInstanceTest.class/instance/testBefore.st](https://app.codecov.io/gh/SeasideSt/Seaside/pull/1380?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=SeasideSt#diff-cmVwb3NpdG9yeS9KUXVlcnktVGVzdHMtQ29yZS5wYWNrYWdlL0pRdWVyeUluc3RhbmNlVGVzdC5jbGFzcy9pbnN0YW5jZS90ZXN0QmVmb3JlLnN0) | `100.00% <100.00%> (ø)` | | | [...kage/JQueryInstanceTest.class/instance/testHtml.st](https://app.codecov.io/gh/SeasideSt/Seaside/pull/1380?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=SeasideSt#diff-cmVwb3NpdG9yeS9KUXVlcnktVGVzdHMtQ29yZS5wYWNrYWdlL0pRdWVyeUluc3RhbmNlVGVzdC5jbGFzcy9pbnN0YW5jZS90ZXN0SHRtbC5zdA==) | `100.00% <100.00%> (ø)` | | | [...e/JQueryInstanceTest.class/instance/testPrepend.st](https://app.codecov.io/gh/SeasideSt/Seaside/pull/1380?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=SeasideSt#diff-cmVwb3NpdG9yeS9KUXVlcnktVGVzdHMtQ29yZS5wYWNrYWdlL0pRdWVyeUluc3RhbmNlVGVzdC5jbGFzcy9pbnN0YW5jZS90ZXN0UHJlcGVuZC5zdA==) | `100.00% <100.00%> (ø)` | | | [...e/JQueryInstanceTest.class/instance/testReplace.st](https://app.codecov.io/gh/SeasideSt/Seaside/pull/1380?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=SeasideSt#diff-cmVwb3NpdG9yeS9KUXVlcnktVGVzdHMtQ29yZS5wYWNrYWdlL0pRdWVyeUluc3RhbmNlVGVzdC5jbGFzcy9pbnN0YW5jZS90ZXN0UmVwbGFjZS5zdA==) | `100.00% <100.00%> (ø)` | | | [...kage/JQueryInstanceTest.class/instance/testWrap.st](https://app.codecov.io/gh/SeasideSt/Seaside/pull/1380?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=SeasideSt#diff-cmVwb3NpdG9yeS9KUXVlcnktVGVzdHMtQ29yZS5wYWNrYWdlL0pRdWVyeUluc3RhbmNlVGVzdC5jbGFzcy9pbnN0YW5jZS90ZXN0V3JhcC5zdA==) | `100.00% <100.00%> (ø)` | | | [...e.package/JSStream.class/class/encodeString.on..st](https://app.codecov.io/gh/SeasideSt/Seaside/pull/1380?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=SeasideSt#diff-cmVwb3NpdG9yeS9KYXZhc2NyaXB0LUNvcmUucGFja2FnZS9KU1N0cmVhbS5jbGFzcy9jbGFzcy9lbmNvZGVTdHJpbmcub24uLnN0) | `100.00% <100.00%> (ø)` | | | ... and [3 more](https://app.codecov.io/gh/SeasideSt/Seaside/pull/1380?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=SeasideSt) | | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/SeasideSt/Seaside/pull/1380/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=SeasideSt)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.