Skip to content

Trimming leading and following whitespace in package metadata #1295

Description

@dauwhe

The packages spec says the following many, many times about almost all the metadata in the OPF file:

Reading Systems MUST trim all leading and trailing white space [XML] before processing the value.

Inconveniently, the word "trim" does not appear in the XML 1.0 spec.

Conveniently, it turns out that WHATWG has a infrastructure spec (who knew?) that actually has a definition of this

To strip leading and trailing ASCII whitespace from a string, remove all ASCII whitespace that are at the start or the end of the string.

I wonder if we should improve our definition.

Incidentally, it appears many reading systems ignore this. I wrote a test this afternoon...

Metadata

Metadata

Assignees

No one assigned

    Labels

    EPUB33Issues fixed in the EPUB 3.3 revisionSpec-EPUB3The issue affects the core EPUB 3.X Recommendation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions