Commit b8863cd8 authored by David Sveningsson's avatar David Sveningsson

fix(rules): `no-missing-references` ignores omitted references

parent 5f678a56
......@@ -38,6 +38,11 @@ describe("rule no-missing-references", () => {
expect(report).toBeValid();
});
it("should not report error when reference is omitted", () => {
const report = htmlvalidate.validateString("<label for></label>");
expect(report).toBeValid();
});
it("should not report error when reference is empty string", () => {
const report = htmlvalidate.validateString('<label for=""></label>');
expect(report).toBeValid();
......
......@@ -51,7 +51,7 @@ class NoMissingReferences extends Rule<Context> {
): void {
const id = attr.value;
if (id instanceof DynamicValue || id === "") {
if (id instanceof DynamicValue || id === null || id === "") {
return;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment