Eren
Eren

Reputation: 41

The mandatory text (CDATA) inside tag 'head > style[amp-boilerplate]' is missing or incorrect

Why am I receiving this error? i use wordpress and using Automattic AMP plugin.

The mandatory text (CDATA) inside tag 'head > style[amp-boilerplate]' is missing or incorrect. MANDATORY_AMP_TAG_MISSING_OR_INCORRECT line 1, column 473

The mandatory text (CDATA) inside tag 'noscript > style[amp-boilerplate]' is missing or incorrect. MANDATORY_AMP_TAG_MISSING_OR_INCORRECT line 10, column 19

<!doctype html><html amp lang="tr-TR"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"><title>Example</title><link rel="canonical" href="http://www.example.com/okul-kombinleri/" /> <script src="https://cdn.ampproject.org/v0.js" async></script> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Merriweather:400,400italic,700,700italic"><style amp-boilerplate>body {
-webkit-animation:0 8s steps(1,end) 0 1 normal both;
-moz-animation:0 8s steps(1,end) 0 1 normal both;
-ms-animation:0 8s steps(1,end) 0 1 normal both;
animation:0 8s steps(1,end) 0 1 normal both;
}

to {
visibility:visible;
}</style><noscript><style amp-boilerplate>body {
-webkit-animation:none;
-moz-animation:none;
-ms-animation:none;
animation:none;
}</style></noscript> 

Upvotes: 3

Views: 775

Answers (1)

Kist221
Kist221

Reputation: 1

According to the AMP HTML specs, I believe you need to remove all new lines from the AMP boilerplate code because it's validated with regex (regular expressions) so all new lines are being read as "\n" causing errors.

Direct from the docs

AMP Boilerplate Code ('head > style[amp-boilerplate]' and 'noscript > style[amp-boilerplate]')

AMP HTML documents must contain the following boilerplate in their head tag. Validation is currently done with regular expressions, so it's important to keep mutations as minimal as possible. Currently, allowed mutations are: (1) inserting arbitrary whitespace immediately after the style tag opens, and immediately before it closes; (2) replacing any space in the snippet below with arbitrary whitespace.

amphtml/spec/amp-boilerplate.md

Upvotes: 0

Related Questions