Skip to content

accessModeSufficient check is broken, as it will not accept a list of more than two comma-separated values #331

@JohnThomson

Description

@JohnThomson

Ace version 1.1.1
Node version 12.14.0
Windows 10

For example, if content.opf contains <opf:meta property="schema:accessModeSufficient">textual,visual,auditory</opf:meta>
the ACE json report contains
"assertions": [
{
"@type": "earl:assertion",
"earl:result": {
"earl:outcome": "fail",
"dct:description": "'schema:accessModeSufficient' metadata must be set to one of the expected values"
},
"earl:assertedBy": "Ace",
"earl:mode": "automatic",
"earl:test": {
"earl:impact": "moderate",
"dct:title": "metadata-accessmodesufficient-invalid",
"dct:description": "Value 'visual,auditory' is invalid for 'schema:accessModeSufficient' metadata",
"help": {
"url": "http://kb.daisy.org/publishing/docs/metadata/schema-org.html",
"dct:title": "Schema.org Accessibility Metadata",
"dct:description": "Use one of the metadata values defined by schema.org"
},
"rulesetTags": [
"EPUB"
]
}
}
],
Note that it has evaluated the 2nd and 3rd elements in the list as a single item "visual,auditory"

I found the problem on line 78 of checker-epub.js, where replace(',', ' ') only replaces the first comma.
It should be replace(/,/g, ' ')

The attached zip is actually a complete epub. Not a minimal demonstration, but it does produce the error.

Hoping to submit a PR shortly...

Atchoum !-français.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions