Skip to content

Commit 113d3af

Browse files
committed
Update hreview backcompat
Fix reviewer -> p-author h-card backcompat
1 parent 8e571f8 commit 113d3af

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

Mf2/Parser.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1656,6 +1656,16 @@ public function backcompat(DOMElement $el, $context = '', $isParentMf2 = false)
16561656
}
16571657
}
16581658

1659+
$reviewer_nodes = $this->xpath->query('.//*[contains(concat(" ", normalize-space(@class), " "), " reviewer ")]', $el);
1660+
1661+
if ( $reviewer_nodes->length ) {
1662+
foreach ( $reviewer_nodes as $tempEl ) {
1663+
if ( !$this->hasRootMf2($tempEl) ) {
1664+
$this->addMfClasses($tempEl, 'p-author h-card');
1665+
}
1666+
}
1667+
}
1668+
16591669
$this->upgradeRelTagToCategory($el);
16601670
break;
16611671

@@ -2070,10 +2080,7 @@ public function query($expression, $context = null) {
20702080
'replace' => 'p-item h-item',
20712081
'context' => 'item'
20722082
),
2073-
'reviewer' => array(
2074-
'replace' => 'p-author h-card',
2075-
'context' => 'vcard',
2076-
),
2083+
# reviewer: see backcompat()
20772084
'dtreviewed' => array(
20782085
'replace' => 'dt-published'
20792086
),

0 commit comments

Comments
 (0)