To separate an EPUB file to multiple file, I need to find all <h2 and replace them with <hr class="sigil_split_marker" /><h2. However, each element of a chapter is consisted in its own html file, which means I can only replace once at a time. And when splitting it, it gives the error:

Cannot split since at least one file may not be an HTML file.

Q: How to split the file into multiple files, each consists the opening image, chapter name and its contain?

Below is the structure of the file:


Every page has the same head.

<html xmlns="http://www.w3.org/1999/xhtml">
    <title>Packing for Mars</title>
    <meta content="http://www.w3.org/1999/xhtml; charset=utf-8" http-equiv="Content-Type"/>
<link href="../Styles/stylesheet.css" type="text/css" rel="stylesheet"/>
<style type="text/css">
        @page { margin-bottom: 5.000000pt; margin-top: 5.000000pt; }</style>


  <body class="calibre">
<div id="filepos129415" class="calibre1">
<div class="calibre30">
<p class="calibre31"><img alt="image" src="../Images/00006.jpg" class="calibre16"/></p>
<div class="calibre32"></div>

Chapter name

  <body class="calibre">
<h2 class="calibre13" id="calibre_pb_30"><span class="calibre10"><span class="bold"><span><span class="bold">YOU GO FIRST</span></span></span></span></h2>
<div class="calibre32"></div>
<p class="calibre8"><span class="calibre12"><span class="bold"><span><span class="italic">CHAPTER NAME</span></span></span></span></p>
<div class="calibre28"></div>
<div class="calibre1">


  <body class="calibre">
<div class="mbppagebreak" id="calibre_pb_31"></div>
<p class="calibre33">&#160;</p>
<p>Loren Ipsum</p>
  • I've never seen this error message. This might be a bug. You might want to ask the Sigil developers about this in the MR Sigil forum forum. – Nemo XXX Jan 10 '18 at 21:32
  • perhaps the files are in xhtml, not html, so Sigil can't process it – Ooker Jan 11 '18 at 3:33
  • No. Sigil can handle HTML, XHTML and HTML5 files. If you got an error message, there are either syntax errors in your file or it's a Sigil bug. The best way is to ask the developers in the MR forum, because they'll know why this error message is displayed. – Nemo XXX Jan 11 '18 at 13:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.