Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Commit

Permalink
Revert "Merge pull request #107 from WordPress/fix/attributes-length"
Browse files Browse the repository at this point in the history
This reverts commit b822772, reversing
changes made to aee404f.
  • Loading branch information
SantosGuillamot committed Dec 2, 2022
1 parent 22de721 commit 9aa2b82
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions src/runtime/vdom.js
Expand Up @@ -9,21 +9,19 @@ export default function toVdom(node) {

if (node.nodeType === 3) return node.data;

if (attributes) {
for (let i = 0; i < attributes.length; i++) {
const n = attributes[i].name;
if (n[0] === 'w' && n[1] === 'p' && n[2] === '-' && n[3]) {
hasWpDirectives = true;
let val = attributes[i].value;
try {
val = JSON.parse(val);
} catch (e) {}
const [, prefix, suffix] = /wp-([^:]+):?(.*)$/.exec(n);
wpDirectives[prefix] = wpDirectives[prefix] || {};
wpDirectives[prefix][suffix || 'default'] = val;
} else {
props[n] = attributes[i].value;
}
for (let i = 0; i < attributes.length; i++) {
const n = attributes[i].name;
if (n[0] === 'w' && n[1] === 'p' && n[2] === '-' && n[3]) {
hasWpDirectives = true;
let val = attributes[i].value;
try {
val = JSON.parse(val);
} catch (e) {}
const [, prefix, suffix] = /wp-([^:]+):?(.*)$/.exec(n);
wpDirectives[prefix] = wpDirectives[prefix] || {};
wpDirectives[prefix][suffix || 'default'] = val;
} else {
props[n] = attributes[i].value;
}
}

Expand Down

0 comments on commit 9aa2b82

Please sign in to comment.