From be15539af93f84f641f32a845339fee599bca00f Mon Sep 17 00:00:00 2001 From: "J. King" Date: Wed, 12 Jul 2023 18:12:33 -0400 Subject: [PATCH] Be me explicit about skipping props and roots in VCP --- lib/Microformats/Parser.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Microformats/Parser.php b/lib/Microformats/Parser.php index 9c9024b..ff7b1b5 100644 --- a/lib/Microformats/Parser.php +++ b/lib/Microformats/Parser.php @@ -985,15 +985,15 @@ class Parser { $skipChildren = false; $classes = $this->parseTokens($node, "class"); $candidate = null; - if (!array_intersect(["value", "value-title"], $classes) && ( + if ( ($backcompatTypes && ($this->matchPropertiesBackcompat($classes, $backcompatTypes, $node) || $this->matchRootsBackcompat($classes))) || ($this->matchRootsMf2($classes) || $this->matchPropertiesMf2($classes)) - )) { - // only consider elements which are not themselves properties or roots, unless they have a value + ) { + // only consider elements which are not inside properties or roots // NOTE: The specification doesn't mention roots, but these should surely be skipped as well $skipChildren = true; - continue; - } elseif ($node->hasAttribute("title") && in_array("value-title", $classes)) { + } + if ($node->hasAttribute("title") && in_array("value-title", $classes)) { $candidate = $node->getAttribute("title"); } elseif (in_array("value", $classes)) { # Where an element with such a microformat property class name