Skip to content

Commit

Permalink
fix: Drop support setting a legacy guide element in EPUB OPF
Browse files Browse the repository at this point in the history
  • Loading branch information
spring-raining committed Mar 10, 2024
1 parent b7c4fde commit 21200d6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
10 changes: 0 additions & 10 deletions src/output/epub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@ export async function exportEpub({
manifest,
spineItems,
manifestItems: Object.values(manifestItem),
landmarks,
}),
'utf8',
);
Expand Down Expand Up @@ -567,15 +566,13 @@ function buildEpubPackageDocument({
docLanguages,
spineItems,
manifestItems,
landmarks,
}: Pick<Parameters<typeof exportEpub>[0], 'epubVersion'> & {
manifest: PublicationManifest;
uid: string;
docTitle: string;
docLanguages: string[];
spineItems: SpineEntry[];
manifestItems: ManifestEntry[];
landmarks: LandmarkEntry[];
}): string {
const slugger = new GithubSlugger();
slugger.reset();
Expand Down Expand Up @@ -699,13 +696,6 @@ function buildEpubPackageDocument({
})),
],
},
guide: {
reference: landmarks.map(({ type, href, text }) => ({
_type: type,
_href: href,
_title: text,
})),
},
},
});
}
Expand Down
6 changes: 0 additions & 6 deletions tests/__snapshots__/epub.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ exports[`generate EPUB from series of HTML files > content.opf 1`] = `
<itemref idref=\\"srcaindexxhtml\\"></itemref>
<itemref idref=\\"srcbcdxhtml\\"></itemref>
</spine>
<guide>
<reference type=\\"toc\\" href=\\"src/index.xhtml#toc\\" title=\\"Table of Contents\\"></reference>
</guide>
</package>
"
`;
Expand Down Expand Up @@ -130,9 +127,6 @@ exports[`generate EPUB from single HTML with pub manifest > content.opf 1`] = `
<spine page-progression-direction=\\"rtl\\">
<itemref idref=\\"indexxhtml\\"></itemref>
</spine>
<guide>
<reference type=\\"toc\\" href=\\"index.xhtml#toc\\" title=\\"Table of Contents\\"></reference>
</guide>
</package>
"
`;
Expand Down

0 comments on commit 21200d6

Please sign in to comment.