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

fix: #331 validation accepts list of more than 2 comma-separated items #332

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/ace-core/src/checker/checker-epub.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function checkMetadata(assertions, epub) {
values = [values]
}
// Parse list values
values = values.map(value => value.trim().replace(',', ' ').replace(/\s{2,}/g, ' ').split(' '))
values = values.map(value => value.trim().replace(/,/g, ' ').replace(/\s{2,}/g, ' ').split(' '))
values = [].concat(...values);
// Check metadata values are allowed
// see https://www.w3.org/wiki/WebSchemas/Accessibility
Expand Down
2 changes: 1 addition & 1 deletion tests/data/epubrules-metadata/EPUB/package.opf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<meta property="schema:accessibilityHazard">noMotionSimulationHazard</meta>
<!-- Fail #2: bad metadata value -->
<meta property="schema:accessMode">text</meta>
<meta property="schema:accessModeSufficient">visual,textual</meta>
<meta property="schema:accessModeSufficient">visual,textual,auditory</meta>
</metadata>
<manifest>
<item id="nav" href="nav.xhtml" media-type="application/xhtml+xml" properties="nav"/>
Expand Down