木偶将元素从头部移动到身体

时间:2018-08-31 06:27:33

标签: puppeteer

在使用ESI(包含边的边)的文件中,esi:include个元素从head移到body。如果将esi:include更改为foo或任何其他非标准HTML元素,也会发生相同的事情:

之前:

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="robots" content="noindex, nofollow">
  <esi:include src="/head.html"></esi:include>
  <title>Test</title>
</head>
<body>
  <h1>Test</h1>
</body>
</html>

之后:

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="robots" content="noindex, nofollow">
  <title>Test</title>
</head>
<body>
  <esi:include src="/head.html"></esi:include>
  <h1>Test</h1>
</body>
</html>

这是故意的吗?我可以防止它发生吗?

1 个答案:

答案 0 :(得分:0)

根据https://www.w3.org/MarkUp/html3/dochead.htmlhttps://developer.mozilla.org/en-US/docs/Web/HTML/Element/head#See_also,以下元素对有效: