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

Metadata injection feature duplicates meta tags in two formats #31

Open
martinpub opened this issue Jun 18, 2021 · 6 comments
Open

Metadata injection feature duplicates meta tags in two formats #31

martinpub opened this issue Jun 18, 2021 · 6 comments

Comments

@martinpub
Copy link
Collaborator

Hi @bertfrees!

We discovered a bug in the metadata injection part of the epub3-to-epub3 script.

When processing package.opf, it seems the injector makes duplicates like:

<meta property="schema:accessibilityFeature">structuralNavigation</meta>
<meta name="schema:accessibilityFeature" content="structuralNavigation"/>

Only the first model is correct in package.opf.

The values are correctly inserted/replaced however and there seems to be no mismatch between the contents of the duplicate lines.

(This happens also to items not requested for update by being represented in the input metadata xml, but that's probably expected.)

Is there an easy fix? This is highly prioritised, so an estimate would be very much appreciated. If you are not available for fixing, we can pass it on to @fredrikschill, @kalaspuffar, et al., just let us know.

@bertfrees
Copy link
Collaborator

Hi Martin. It's allowed in EPUB: https://www.w3.org/publishing/epub3/epub-packages.html#sec-metadata-elem (see "OPF2 meta"). Does Nordic EPUB put additional restrictions?

@bertfrees
Copy link
Collaborator

But to answer your question: yes, it's an easy fix. There is a "compatibility-mode" option on the px:epub3-add-metadata step which can be set to false.

Better than always disabling it would be to automatically determine whether it is desired or not, based on existing metadata in the package doc. Or the option could be exposed to the user.

@martinpub
Copy link
Collaborator Author

Hi @bertfrees, and thanks for your quick answer. Actually, I missed that this legacy metadata was allowed in EPUB 3, thanks for enlightening me. No, it's not explicitly forbidden in the Nordic Guidelines, but we are not actively targetting EPUB 2 backwards compatibility.

I guess this should not be considered a bug. Could legacy meta tag compliance be made optional maybe?

@martinpub
Copy link
Collaborator Author

martinpub commented Jun 18, 2021

@bertfrees Just missed you second post :-)

Great ideas for determining the format based on the existing metadata. I will remove the bug label and also lower the priority.

Let me know if you need anything!

@martinpub
Copy link
Collaborator Author

Hi @bertfrees, we are still interested in your suggestion to make the introduction of EPUB 2 metadata optional. One example were it will create not so neat metadata is the following input:

<meta property="schema:accessibilitySummary" xml:lang="sv">Den här publikationen är framställd i enlighet med the Nordic Guidelines for the Production of Accessible EPUB 3, version 2020-1.</meta>
<meta property="schema:accessibilitySummary" xml:lang="en">This publication conforms to the Nordic Guidelines for the Production of Accessible EPUB 3, version 2020-1.</meta>

which has the following output:

      <meta property="schema:accessibilitySummary" xml:lang="sv">Den här publikationen är framställd i enlighet med the Nordic Guidelines for the Production of Accessible EPUB 3, version 2020-1.</meta>
      <meta name="schema:accessibilitySummary"
            content="Den här publikationen är framställd i enlighet med the Nordic Guidelines for the Production of Accessible EPUB 3, version 2020-1."/>
      <meta property="schema:accessibilitySummary" xml:lang="en">This publication conforms to the Nordic Guidelines for the Production of Accessible EPUB 3, version 2020-1.</meta>
      <meta name="schema:accessibilitySummary"
            content="This publication conforms to the Nordic Guidelines for the Production of Accessible EPUB 3, version 2020-1."/>

As you can see, the repeated EPUB 2 entries do not carry the language attributes.

@martinpub
Copy link
Collaborator Author

Just wanted to let you know, this is not blocking us, just a suggestion for improvement.

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

No branches or pull requests

2 participants