-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid empty properties like id='' which is invalid #142
Conversation
|
@AIC-BV can you add example of the generated markup before/after this PR is applied? |
@mjauvin Where empty ID is invalid and throwing w3c errors. |
@AIC-BV this could cause issues with attribute values that are considered "empty" but would actually be valid, i.e. |
@LukeTowers |
@AIC-BV excellent learning opportunity then :) You'll want to clone this repository locally (and run composer install) and then add a file to In that method, you'd then think of every input / output combination that you can think of that would address the different code branching paths available in the current implementation of the Once you've written the test you can run it by running If you have access to it, github copilot or chatgpt can be pretty helpful with generating tests for you, but give it a shot yourself first. Unit testing can be a bit intimidating to get into, but once you've done a couple you'll see that it's not really that complicated and it can be incredibly helpful to your development process. |
Co-authored-by: Marc Jauvin <[email protected]>
@LukeTowers we changed to !isset() should be safe. |
@mjauvin but that doesn't actually solve the original issue does it? |
Why not? |
Because the value would still be null, not void wouldn't it? |
It happens when the id attribute is not provided, so isset is appropriate (and was tested as a working solution) |
If we can get a test case that demonstrates that I'm fine with merging :) Just don't have the time to reproduce locally at the moment. |
Replaced by #143 |
Credits to @mjauvin