-
Notifications
You must be signed in to change notification settings - Fork 36
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
Should error for <span> that fails to xref #33
Comments
So the solution is in changing line 454. However, I cannot get if (Element.HasAttribute(kCrossRefAttribute) or Element.IsIdentity(nsHTML, eCode) or (Element.IsIdentity(nsHTML, eSpan) and Element.Attributes.Count = 0)) then or variants to compile. I'm not sure what's wrong since @Hixie can you help? (We need to ignore |
Found while working on whatwg/wattsi#33. I also took the liberty to remove erroneous title attributes. #2097 is follow-up.
I remember running into a similar problem before. To fix it I think you need to do this (wrapped for readability):
That is, with parens in " Otherwise without the parens, if there’s a bare identifier after the So I think in Pascal to make a compiler evaluate the |
I tried that, same or nearly the same result unfortunately. |
To be clear, that makes it compile, but running it results in:
|
Only do this when the <span> has no attributes as using the lang/class/id attributes should continue to be okay. Fixes #33.
The overall problem was that an Element without attributes never gets Attributes assigned. So the correct way would be |
Isn't there a HasAttributes? |
I don't think so. At least your code also does this Assigned trick in a number of places. |
(meta point) I guess we could add a HasAttributes that returns boolean, but even if we did I wonder what other need we’d ever end up having for it. The need right now is that we want to: A. identify and report cases of xref So starting by only checking for But other than the |
In current tip of tree, lines 241 and 1447 also do this check, both related to attribute counting. I'm not sure at what point it's worth having an abstraction, but I don't think this is quite it. (And if anything, this might more argue for some counting abstraction.) |
So something like this will happily be converted to a link:
Maybe we should switch to |
Found while working on whatwg/wattsi#33. I also took the liberty to remove erroneous title attributes. #2097 is follow-up.
True, we could probably exclude |
Yes, agreed. Filed #38 |
Only do this when the <span> has no attributes as using the lang/class/id attributes should continue to be okay. Fixes #33.
Found while working on whatwg/wattsi#33. I also took the liberty to remove erroneous title attributes. whatwg#2097 is follow-up.
<span>no such term</span>
should be an error.The text was updated successfully, but these errors were encountered: