Description
Bug Description
<noscript>
elements with the data-amp-no-unwrap
property in the <head>
are unwrapped regardless.
Expected Behaviour
<noscript data-amp-no-unwrap><style> /* This CSS applies only if JS is off. */ </style></noscript>
Screenshots
In the body, there is this test code:
<noscript data-amp-no-unwrap>JavaScript is off.</noscript><br />
<noscript>This page is served as AMP if this message shows up while JavaScript is on.</noscript>
On a page served as AMP: https://anrghg.sunsite.fr/test-amp-compat/features/helpers/#127-amp-compatibility
On a non-AMP page: https://anrghg.sunsite.fr/publishing-helper/features/helpers/#127-amp-compatibility
(before the next heading).
In the head, there is this selector on both pages:
.anrghg-display-toggle:not(:checked)+.anrghg-tocontents .anrghg-contents-list .anrghg-contents-heading:target
On the non-AMP page, it is wrapped into <noscript data-amp-no-unwrap>
.
On the AMP page, it survives tree-shaking and is in the valid CSS because it is unwrapped.
The adverse effect on the AMP is that a TOC item shows up below the TOC label after clicking a heading number, then reloading the page, while JS is on.
PHP Version
8.1
Plugin Version
2.3.0
AMP plugin template mode
Standard
WordPress Version
6.0.1
Site Health
Gutenberg Version
OS(s) Affected
Linux
Browser(s) Affected
Brave
Device(s) Affected
desktop
Acceptance Criteria
No response
Implementation Brief
No response
QA Testing Instructions
No response
Demo
No response
Changelog Entry
No response