-
Notifications
You must be signed in to change notification settings - Fork 18
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
Assign IDs to all principles. #455
Conversation
index.html
Outdated
for (const practice of document.querySelectorAll(".practicelab")) { | ||
if (!practice.id) { | ||
utils.showWarning( | ||
`Principle should be assigned an id.`, { elements: [practice] } | ||
); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might also work? #codeshedding =)
for (const practice of document.querySelectorAll(".practicelab")) { | |
if (!practice.id) { | |
utils.showWarning( | |
`Principle should be assigned an id.`, { elements: [practice] } | |
); | |
} | |
} | |
document.querySelectorAll(".practicelab:not([id])").forEach(practice => { | |
utils.showWarning( | |
`Principle should be assigned an id.`, { elements: [practice] } | |
); | |
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point on the :not([id])
. I've generally concluded that language-level loops are more readable than the functional-programming methods, when they're not significantly longer, but I'll switch the selector.
SHA: 33bd8f3 Reason: push, by jyasskin Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
I noticed this when I wanted to link to one of these, and the ID was a couple lines long.
Preview | Diff