Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> you probably still can't use the string literal '</script>' within an inline script.

You're right: https://jsfiddle.net/pLo9bdhs




Think about the failure cases for `</script>` and `</style>` and it's obvious why the spec defines them that way.

If CSS and JS syntax were to decide when the end tags can appear, some malformed CSS or JS would break the end tag and cause the entire rest of the document to vanish as the browser wouldn't recognise it as HTML.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: