Skip to content

Commit

Permalink
minor bug fixes with epub processing
Browse files Browse the repository at this point in the history
  • Loading branch information
mattgarrish committed Jan 16, 2025
1 parent 1537b03 commit a8345f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion js/packageProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,10 @@ var packageProcessor = (function() {
var conformance = package_document.evaluate(xpath.conformance[version], package_document, nsResolver, XPathResult.STRING_TYPE, null).stringValue;

if (conformance) {
conformance_string = conformance.replace(' - ', ' ');

conformance = conformance.trim();

conformance_string = conformance.replace(' - ', ' ').trim();

var level_re = new RegExp('EPUB Accessibility 1\\.1 - WCAG 2\\.[0-2] Level ');
wcag_level = conformance.replace(level_re, '');
Expand Down
2 changes: 1 addition & 1 deletion js/xpaths.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ var xpath = {
onix: '/onix:ONIXMessage/onix:Product/onix:DescriptiveDetail/onix:ProductFormFeature[onix:ProductFormFeatureType = "12" and onix:ProductFormFeatureValue = "17"]'
},
no_motion_hazards: {
epub3: '/opf:package/opf:metadata/opf:meta[@property="schema:accessibilityHazard" and normalize-space()="noMotionSimulation"]',
epub3: '/opf:package/opf:metadata/opf:meta[@property="schema:accessibilityHazard" and normalize-space()="noMotionSimulationHazard"]',
epub2: '/opf:package/opf:metadata/opf:meta[@name="schema:accessibilityHazard" and @content="noMotionSimulation"]',
onix: '/onix:ONIXMessage/onix:Product/onix:DescriptiveDetail/onix:ProductFormFeature[onix:ProductFormFeatureType = "12" and onix:ProductFormFeatureValue = "18"]'
},
Expand Down

0 comments on commit a8345f3

Please sign in to comment.