Skip to content

Commit b16e814

Browse files
committed
Fix bug with meta tags with content attribute
Meta tags with non-empty `content` attribute would confuse the script and attempt to treat the content string as a Template.content tree.
1 parent 5ae4260 commit b16e814

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

html-api-debugger/print-html-tree.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,10 @@ export function printHtmlApiTree(node, ul, options = {}) {
172172
}
173173
}
174174

175-
if (node.childNodes[i].childNodes?.length || node.childNodes[i].content) {
175+
if (
176+
node.childNodes[i].childNodes?.length ||
177+
(node.childNodes[i].nodeName === 'TEMPLATE' && node.childNodes[i].content)
178+
) {
176179
const next = node.childNodes[i].childNodes?.length
177180
? node.childNodes[i]
178181
: node.childNodes[i].content;

html-api-debugger/readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,4 @@ Add a page to wp-admin for debugging the HTML API.
7777

7878
= 1.6 =
7979
* Replace TABLE based layout with CSS grid.
80+
* Fix a crash on meta tags with a content attribute.

0 commit comments

Comments
 (0)