go-toolkit
go-toolkit copied to clipboard
(pub.Publication).Get when href contains anchors
Calling Get when a manifest.Link Href contains anchors returns resource: error 404: file does not exist
an example Manifest.TableOfContents
manifest.Link{
Href: "/OEBPS/Text/appendice1.xhtml",
Type: "",
Templated: false,
Title: "APPENDICE A ANNALI DEI RE E DEI GOVERNATORI",
Rels: manifest.Strings{},
Properties: manifest.Properties{},
Height: 0x0,
Width: 0x0,
Bitrate: 0.000000,
Duration: 0.000000,
Languages: manifest.Strings{},
Alternates: manifest.LinkList{},
Children: manifest.LinkList{
manifest.Link{
Href: "/OEBPS/Text/appendice1.xhtml#sec1",
Type: "",
Templated: false,
Title: "I. I re Númenóreani",
Rels: manifest.Strings{},
Properties: manifest.Properties{},
Height: 0x0,
Width: 0x0,
Bitrate: 0.000000,
Duration: 0.000000,
Languages: manifest.Strings{},
Alternates: manifest.LinkList{},
Children: manifest.LinkList{},
},
manifest.Link{
Href: "/OEBPS/Text/appendice1.xhtml#sec2",
Type: "",
Templated: false,
Title: "II. La casa di Eorl",
Rels: manifest.Strings{},
Properties: manifest.Properties{},
Height: 0x0,
Width: 0x0,
Bitrate: 0.000000,
Duration: 0.000000,
Languages: manifest.Strings{},
Alternates: manifest.LinkList{},
Children: manifest.LinkList{},
},
A check on anchors could be added to Get
?
In the mobile toolkits, we are dropping both fragments and query parameters from the href as a fallback, in Publication.get()
:
https://github.com/readium/kotlin-toolkit/blob/482ab0c2d759b4484762b0b823a953cc66661259/readium/shared/src/main/java/org/readium/r2/shared/publication/Publication.kt#L206-L210