Skip to content
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

Tag IDs cannot start with 0 (zero) character #32

Closed
gronka opened this issue Aug 6, 2017 · 1 comment
Closed

Tag IDs cannot start with 0 (zero) character #32

gronka opened this issue Aug 6, 2017 · 1 comment

Comments

@gronka
Copy link

gronka commented Aug 6, 2017

Using diet-ng 1.3.0

Sorry if this is a bit brief. Seems like a straightforward bug though. The following fails to build, apparently due to the id beginning with "0":

select#timezone(name="timezone")
    option#0000(value="0000") GMT Casablanca, London, Lisbon, Monrovia
    option#0060(value="0060") GMT +1:00 Amsterdam, Berlin, Madrid, Paris, Rome

Part of the error message:
Compiling Diet HTML template event/create.dt...
../../.dub/packages/diet-ng-1.3.0/diet-ng/source/diet/defs.d(34,3): Error: "pieces/timezone.dt(15): Expected identifier but got '0'."
../../.dub/packages/diet-ng-1.3.0/diet-ng/source/diet/parser.d(1369,13): called from here: enforcep(accept_empty || start != idx, delegate string() => "Expected identifier but got '" ~ s[idx] ~ "'.", loc)
../../.dub/packages/diet-ng-1.3.0/diet-ng/source/diet/parser.d(1051,26): called from here: skipIdent(input, idx, "-_", loc, false)
../../.dub/packages/diet-ng-1.3.0/diet-ng/source/diet/parser.d(992,15): called from here: parseTag(input, idx, ret, has_nested, loc)
../../.dub/packages/diet-ng-1.3.0/diet-ng/source/diet/parser.d(950,38): called from here: parseTagLine(input, loc, has_nested)
../../.dub/packages/diet-ng-1.3.0/diet-ng/source/diet/parser.d(65,76): called from here: parseDietRaw(f)
/usr/include/dmd/phobos/std/algorithm/iteration.d(597,19): called from here: __lambda2(front(this._input))
/usr/include/dmd/phobos/std/array.d(106,9): called from here: __r6554.front()
../../.dub/packages/diet-ng-1.3.0/diet-ng/source/diet/parser.d(65,81): called from here: array(map(files))
../../.dub/packages/diet-ng-1.3.0/diet-ng/source/diet/html.d(93,90): called from here: parseDiet([InputFile("event/create.dt", ......................

Workaround for now is to simply use:
option(value="0000", id="0000") GMT Casablanca, London, Lisbon, Monrovia

@gronka
Copy link
Author

gronka commented Aug 6, 2017

HTML5 at least now allows ids comprised entirely of digits
https://www.w3.org/TR/html5/dom.html#the-id-attribute

It seems the old restriction that an id must start with a character is gone (although I now wonder if that 'character' could have been a zero. I assumed not... oh well).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant