diff options
author | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2021-07-19 19:04:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-19 19:04:23 +0200 |
commit | 2f8f39e457c32c454c50545b0fdaa1d7a4a2f8bd (patch) | |
tree | d480658de50bccb6ae9e023439d5580d9dc09166 /README.md | |
parent | 0f623fdc8db128657716290cb7d57430e224c977 (diff) | |
download | jquery-2f8f39e457c32c454c50545b0fdaa1d7a4a2f8bd.tar.gz jquery-2f8f39e457c32c454c50545b0fdaa1d7a4a2f8bd.zip |
Manipulation: Don't remove HTML comments from scripts
When evaluating scripts, jQuery strips out the possible wrapping HTML comment
and a CDATA section. However, all supported browsers are already doing that
when loading JS via appending a script tag to the DOM which is how we've been
doing `jQuery.globalEval` since jQuery 3.0.0. jQuery logic was imperfect, e.g.
it just stripped the `<!--` and `-->` markers, respectively at the beginning or
the end of the script contents. However, browsers are also stripping everything
following those markers in the same line, treating them as single-line comments
delimiters; this is now also mandated by ECMAScript 2015 in Annex B. Instead
of fixing the jQuery logic, just let the browser do its thing.
We also used to strip CDATA sections. However, this shouldn't be needed as in
XML documents they're already not visible when inspecting element contents and
in HTML documents they have no meaning. We've preserved that behavior for
backwards compatibility in 3.x but we're removing it for 4.0.
Fixes gh-4904
Closes gh-4906
Diffstat (limited to 'README.md')
0 files changed, 0 insertions, 0 deletions