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

Fixes for A11y metadata #208

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open

Fixes for A11y metadata #208

wants to merge 3 commits into from

Conversation

chocolatkey
Copy link
Member

@chocolatkey chocolatkey commented Mar 18, 2025

As mentioned in #194 , long term we should think about adjusting the parsing logic for child meta elements (elements that refine another) in the OPF, since our logic might end up ignoring them

for _, item := range items {
if profile := a11yProfile(item.value); profile != "" {
profiles = append(profiles, profile)
for k, v := range item.children {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I read correctly that the refined metadata of the last conformsTo declared will override all the other accessibility metadata? In which case we're loosing the other metadata (global or refined). Is this what we want @HadrienGardeur?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I'm following that one since conformsTo should be an array of URIs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand the code correctly this will parse the a11y metadata that are refining each dc:conformsTo tags. Although I didn't know that <dc:conformsTo> could be refined, I thought only <meta> with an ID could.

@chocolatkey Do you have an OPF example that this is supposed to parse?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha I see, in that case my initial question stands. We can have several conformances with different IDs and their own refinements.

<meta id="conformance-statement" property="dcterms:conformsTo">EPUB Accessibility 1.1 - WCAG 2.2 Level AA</meta>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then it's probably a limitation of our model because the certification object isn't tied to a particular conformsTo.

I'm hesitant to shake things up though, because it seems quite unlikely that you'd get certified multiple times (in most countries, there won't be a certification process at all).

a11y.Features = m.a11yFeatures()
a11y.Hazards = m.a11yHazards()
a11y.Exemptions = m.a11yExemptions()
ct, refinedA11y := m.a11yConformsTo()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you be able to add test cases for this new logic with the refined metadata? https://github.com/readium/go-toolkit/blob/develop/pkg/parser/epub/metadata_test.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants