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

The property "svg" should be declared in the OPF file #40

Open
neclepsio opened this issue Aug 26, 2024 · 2 comments · May be fixed by #47
Open

The property "svg" should be declared in the OPF file #40

neclepsio opened this issue Aug 26, 2024 · 2 comments · May be fixed by #47
Assignees
Labels
bug Something isn't working

Comments

@neclepsio
Copy link

If I add an <svg> tag to a section, the validator returns this error:

ERROR(OPF-014): prova.epub/EPUB/xhtml/section0001.xhtml(-1,-1): The property "svg" should be declared in the OPF file.

That is, in package.opf there shoud be properties="svg" in the item tag:

    <item id="section0001.xhtml" href="xhtml/section0001.xhtml" media-type="application/xhtml+xml" properties="svg"></item>

I found no way to do it.

Thank you.

@Monirzadeh
Copy link

Monirzadeh commented Aug 27, 2024

Hi
can you please send a html code example that this error happen in it.
or even better exact go code so i can reproduce that.
Thanks

@neclepsio
Copy link
Author

neclepsio commented Aug 27, 2024

func main() {
	e, _ := epub.NewEpub("Prova")
	
	section1Body := `<h1>Section 1</h1>
<p><svg xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"
	id="p001" viewBox="0 0 400 400">

  <g>
    <rect x="0" y="0" width="20" height="20" />
  </g>
</svg></p>`

	_, _ = e.AddSection(section1Body, "Section 1", "", "")

	_ = e.Write("prova.epub")
}

@Monirzadeh Monirzadeh added the bug Something isn't working label Aug 30, 2024
@neclepsio neclepsio linked a pull request Oct 16, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants