Skip to content

Invalid use of infra definition of whitespace #2637

Closed

Description

@mattgarrish

As noted in #2636, we mix the xml and infra definitions of whitespace and whitespace handling for the viewport meta tag value in this paragraph:

The authoring requirements in this section apply after whitespace normalization [xml] (i.e., after a reading system strips leading and trailing whitespace and compacts all instances of multiple whitespace within the attribute to single spaces). EPUB creators MAY include any valid ascii whitespace [infra] in the authored tag so long as the result is valid to this definition.

But the infra definition allows form feed while xml's does not. If you put a form feed character in an xhtml document, it will cause the parser to halt. You can try and twist the definition that form feed is not a "valid" whitespace character, so it's excluded, but why even refer to a definition with invalid whitespace characters? The infra reference only works for html. Since we refer to xml's definition of normalization everywhere else in that section, we should be consistent and refer to xml's whitespace definition, too.

(The other concern I mentioned with package document values is probably fine as is. The two references to infra functions in that section - for leading and trailing whitespace removal and collapsing whitespace in a string - don't change the rules of whitespace authoring in xml. They just add an extra character for processing that isn't ever going to appear. Since xml passes through whitespace in elements, we need some definition for this handling.)

Activity

  1. added
    Spec-EPUB3The issue affects the core EPUB 3.X Recommendation
    ErratumRaisedRaise an erratum, not yet accepted by the maintainers.
    Change-Class-3Requested changes are of class 3 (per process)
    on Jul 15, 2024
  2. iherman commented on Jul 16, 2024

    @iherman
    Member

    Put it another way, your proposal is to remove this sentence:

    EPUB creators MAY include any valid ascii whitespace [infra] in the authored tag so long as the result is valid to this definition.

    I agree. For better or for worse, we work with XHTML, meaning that the xml definition should prevail.

    That being said, and although this being a corner case, maybe a short note right after this (edited) section is worth adding? Just to make this minor difference clear to authoring tools and EPUB creators? Otherwise, they may find themselves facing a difficult-to-find bug.

  3. mattgarrish commented on Jul 16, 2024

    @mattgarrish
    MemberAuthor

    Just to make this minor difference clear to authoring tools and EPUB creators?

    Do you mean to explain the difference between valid html and xhtml whitespace characters? Sounds reasonable, if so.

  4. iherman commented on Jul 16, 2024

    @iherman
    Member

    Just to make this minor difference clear to authoring tools and EPUB creators?

    Do you mean to explain the difference between valid html and xhtml whitespace characters? Sounds reasonable, if so.

    Exactly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Change-Class-3Requested changes are of class 3 (per process)ErratumRaisedRaise an erratum, not yet accepted by the maintainers.Spec-EPUB3The issue affects the core EPUB 3.X Recommendation

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions