-
Notifications
You must be signed in to change notification settings - Fork 402
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
Yearless dates are valid HTML but flagged #775
Comments
AFAIK EPUB 3 specifies a specific HTML 5 subset which is not HTML 5.1 (am I right @mattgarrish?) and the newer HTML versions are only supported by EPUB 3.1 which however isn't supported by EpubCheck yet. |
Thanks for the reply. HTML5.0 also defines a yearless date format as valid for the datetime attribute, and it looks like EPUB 3.0 pretty much wholesale imports the W3C HTML5.0 spec (assuming XHTML serialisation)? Sorry if I’m getting this wrong, I’m new to EPUB stuff. |
Looks like a bug. From what I see, there's no accounting for yearless dates in the date.or.time datatype. I wouldn't modify html.date as that looks like it would allow in input/date which requires a year from my reading. Probably need a new date type like: datatype.html5.date.or.time = datatype.html5.date | datatype.html5.month | datatype.html5.yearless | datatype.html5.time | datatype.html5.datetime.global datatype.html5.yearless = xsd:token { pattern ='(--)?(0[1-9]|1[0-2])-(0[0-9]|[1-2][0-9]|3[0-1])' } (All the other date patterns use simple [0-9] ranges, so maybe the above is a bit of overkill since it will still allow bad dates.) |
Updates the date/times/duration RelaxNG types to better align with the HTML definitions: - adds support for yearless dates, year-only dates, and durations for time/datetime - allows a space in addition to 'T' for separating dates and times - makes the colon optional in timezone offsets - limits seconds to three digits after a period Note: the handling of dates and times is much more limited in epubcheck than HTML allows. Some checks can really only be programmed; this change is more an interim step to future integration. Fix #775
Closed in #957 |
HTML5.1 allows yearless dates, but epubcheck currently flags them. It looks like amending the current set of regexes in datatypes.rnc to include something like
([0-9]{2})-([0-9]{2})
would fix it but this is the first time I’ve looked at the code so I’ll defer unless this doesn’t get picked up.(somewhat similar to #341)
The text was updated successfully, but these errors were encountered: