pdoTools icon indicating copy to clipboard operation
pdoTools copied to clipboard

Three closing "/>" tags

Open ndcstudio opened this issue 1 month ago • 0 comments

The pdoPage snippet contains a piece of code that has three closing "/>" tags.

if (!empty($setMeta)) {
    $canurl = $paginator->pdoTools->config(“scheme”) !== “full”
        ? $paginator->getCanonicalUrl($url)
        : $url;
    $modx->regClientStartupHTMLBlock(“<link rel="canonical" href="” . $canurl . “"/>”);
    if ($data[$pageVarKey] > 1) {
        $prevUrl = $paginator->makePageLink($canurl, $data[$pageVarKey] - 1);
        $modx->regClientStartupHTMLBlock(
            “<link rel="prev" href="” . $prevUrl . “"/>”
        );
    }
    if ($data[$pageVarKey] < $data[$pageCountVar]) {
        $nextUrl = $paginator->makePageLink($canurl, $data[$pageVarKey] + 1);
        $modx->regClientStartupHTMLBlock(
            “<link rel="next" href="” . $nextUrl . “"/>”
        );
    }
}

Unfortunately, these closures cause an error in the W3C validator: Trailing slash on void elements has no effect and interacts badly with unquoted attribute values.

ndcstudio avatar Nov 27 '25 21:11 ndcstudio