-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Open
Labels
Milestone
Description
Describe the bug
Running HTML validation on the Pager shape causes a validation error.
Orchard Core version
"OrchardCore.Application.Cms.Targets" Version="2.1.7"
To Reproduce
- Use pager shape in liquid (shape_pager)
- Previous link has no href, so the rel attribute is shown as an attribute misuse in HTML validation.
Expected behavior
Do not get HTML validation errors.
Logs and screenshots
E.g. using shape_pager in a liquid shape:
error: "rel" attribute cannot be used on <a> in this context: requires "href" attribute to be present (attribute-misuse) at
<ul class="pager pagination"><li class="pager__item page-item first disabled"><a><<</a></li><li class="pager__item page-item disabled">
<a rel="prev"><</a>
</li><li class="pager__item page-item active"><a href="/">1</a></li><li class="pager__item page-item"><a href="/?pagenum=2" rel="next">2</a></li><li class="pager__item page-item"><a href="/?pagenum=2" rel="next">></a></li><li class="pager__item page-item last"><a href="/?pagenum=2">>></a></li></ul>
Details: https://html-validate.org/rules/attribute-misuse.htmlThe previous page link's Disabled property is set to true on page 1:
https://github.com/OrchardCMS/OrchardCore/blob/main/src/OrchardCore.Modules/OrchardCore.Navigation/PagerShapesTableProvider.cs#L234
Then the href attribute is removed:
https://github.com/OrchardCMS/OrchardCore/blob/main/src/OrchardCore.Modules/OrchardCore.Navigation/PagerShapesTableProvider.cs#L528