@@ -1071,7 +1071,9 @@ public function parseH(\DOMElement $e, $is_backcompat = false, $has_nested_mf =
1071
1071
1072
1072
// Do we need to imply a name property?
1073
1073
// if no explicit "name" property, and no other p-* or e-* properties, and no nested microformats,
1074
- if (!array_key_exists ('name ' , $ return ) && !in_array ('p- ' , $ prefixes ) && !in_array ('e- ' , $ prefixes ) && !$ has_nested_mf && !$ is_backcompat ) {
1074
+ if (!array_key_exists ('name ' , $ return ) && !in_array ('p- ' , $ prefixes )
1075
+ && !in_array ('e- ' , $ prefixes ) && !$ has_nested_mf
1076
+ && !$ is_backcompat && empty ($ this ->upgraded [$ e ])) {
1075
1077
$ name = false ;
1076
1078
// img.h-x[alt] or area.h-x[alt]
1077
1079
if (($ e ->tagName === 'img ' || $ e ->tagName === 'area ' ) && $ e ->hasAttribute ('alt ' )) {
@@ -1410,7 +1412,7 @@ public function parse_recursive(DOMElement $context = null, $depth = 0) {
1410
1412
$ recurse = $ this ->parse_recursive ($ node , $ depth + 1 );
1411
1413
1412
1414
// set bool flag for nested mf
1413
- $ has_nested_mf = ($ recurse) ;
1415
+ $ has_nested_mf = (bool ) $ recurse ;
1414
1416
1415
1417
// parse for root mf
1416
1418
$ result = $ this ->parseH ($ node , $ is_backcompat , $ has_nested_mf );
@@ -1827,7 +1829,8 @@ public function query($expression, $context = null) {
1827
1829
'replace ' => 'p-label '
1828
1830
),
1829
1831
'geo ' => array (
1830
- 'replace ' => 'p-geo h-geo '
1832
+ 'replace ' => 'p-geo h-geo ' ,
1833
+ 'context ' => 'geo '
1831
1834
),
1832
1835
'latitude ' => array (
1833
1836
'replace ' => 'p-latitude '
0 commit comments