go-epub
go-epub copied to clipboard
The property "svg" should be declared in the OPF file
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.
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
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")
}