Thanks, everyone, for the lightning-fast replies. I'm sorry, it seems I was hasty and missed something important: the links do update correctly if I close and open the epub *before* running Split at Markers. That is, if I first let Sigil rewrite all internal link paths according to its `../Text/` folder structure.
In all my testing, I never tried closing and opening the epub in Sigil before running Split at Markers.
I'm assembling epubs from standalone HTML files. My source HTML files' internal links are relative within their folder:
href="1.html#hello-world"
Upon opening an epub, Sigil (correctly) rewrites all existing internal links according to its folder structure:
href="../Text/1.html#hello-world"
But if I add files to an open epub in Sigil (using 'Add Existing Files…'), internal links in those files are not updated until I close and reopen the epub. If I close and reopen the epub, the paths update to `../Text/`.
When running Split at Markers, only the `../Text/` paths are updated, and any relative links in the file being split.
So if I've added HTML files to an epub, it's important to close and open the epub before running Split at Markers.
I've attached a zip file containing two HTML files for testing with.
Steps to get incorrect links:
1. Open blank epub in Sigil
2. Add files containing relative links
3. Run Split at Markers
4. Only links in the file being split (1.html) are updated to new paths. Links in 0-3-contents.html are not updated.
Steps to get correct links:
1. Open blank epub in Sigil
2. Add files containing relative links
3. Save epub, close, reopen. Sigil rewrites all link paths by adding `../Text/`
4. Run Split at Markers
5. All links update to new paths correctly.
The workaround (close, reopen, Split) is simple enough. I don't know whether it would be difficult to get Sigil to update relative links when new files are added to an epub, rather than just on opening an epub. Or, alternatively, to get Sigil to update all internal links first when Split at Markers is run.
Or, of course, if I'm still missing something.
|