-
Notifications
You must be signed in to change notification settings - Fork 10
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
Remove 'data-' prefix requirement for setAttribute()
and make more consistent.
#2
Comments
I agree there's some oddness in attribute names, let me see if I can explain. First there's three places to think about attribute names:
|
Briefly summarized in code:
Item.setAttribute(name, value)
would be more intuitive ifname
did not have to be prefixed with "data-". It's confusing thatname
is "data-tag" but the actual tag being set is just the unprefixed "@tag".Furthermore, it seems the prefix is no longer required because the built-in attributes ("id", "indent") now exist in their own properties outside of the
attributeNames
property."data-type" is also a built-in attribute, but I recommend moving it outside, as well. It prevents TaskPaper from properly handling an
Item
with an actual tag named "@type". Or it should at least follow the convention and not be prefixed with "data-"And "indent" is both an
Item
property and found inattributeNames
. The attribute should be removed.Finally, the documentation needs to be updated: The "data-" prefix sounds like an optional convention in the documentation, but any calls where "data-" is not prefixed are actually silently ignored.
I am guessing this issue will have ripple effects with related methods like
getAttribute
and even processing search queries...The text was updated successfully, but these errors were encountered: