kangax / kangax/jstests

ETAGO delimiter test: HTML5^​H update

Open
#1 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
30
Forks
4
PR merge metrics
No merged PRs in 30d

Description

http://kangax.github.com/jstests/etago_delimiter_test/

The full algorithm is described in the HTML spec [here](http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#script-data-end-tag-open-state) and [here](http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#script-data-escaped-end-tag-open-state), but it’s a little hard to read IMHO :)

Anyhow, HTML5^​H now finally standardized the behavior that all browsers implemented in the first place (in spite of what HTML 4.01 prescribed):
1. This works — the alert message will be shown:

``` html
document.write('<p></p>'); alert(1);
```
2. This will prematurely close the `` element — the alert message won’t be shown:

``` html
<script>document.write('<script>'); alert(1);
```

Again, this is how it has always worked in every browser (as your test case states).

It might be worth updating the page to mention that HTML5^​H standardizes what you already discovered, i.e. that only the `` element’s content (depending on the next character), and other `

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the ETAGO delimiter test page at kangax.github.com/jstests/etago_delimiter_test/ and review the linked HTML specification sections on script-data end-tag states. Update the page to explain the standardized behavior and preserve the two demonstrated cases; done when the examples and explanation match the HTML5 rules.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, javascript
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.