After examining the combined markdown file, I've found the true source of the persistent "ewpage" issue. The ewpage text appears right after each page break in the combined file, showing that there's still a problematic segment in the build process.
What I Found in the Combined File
The pattern in the combined file shows:
End of content from a markdown file
The HTML page break that's in the original file
A blank line
The literal text "ewpage"
Start of the next section
This pattern repeats throughout the combined document, confirming that something in the build process is still adding this text despite our previous fixes.
The Complete Solution
I've implemented a more comprehensive fix to the combine-markdown.sh script:
Completely removed all additional page breaks for files that already have them in their source. This eliminates any chance of malformed page break commands being introduced.
Only add HTML-style page breaks to appendices and glossary files if they don't already have them, and use a consistent approach with HTML-style breaks that are compatible with all output formats.
Added checks to avoid adding redundant page breaks if files already contain them.
This approach:
Eliminates any possibility of LaTeX or wrongly-formatted page breaks being added
Respects the page breaks already present in the source files
Maintains a clean build process with minimal modifications to the source content
What to Expect
The next book build should have:
No "ewpage" text in any output format
Proper page breaks in the appropriate places
Consistent rendering across PDF, EPUB and other formats
This should resolve the issue completely. Let me know if you encounter any other problems with the build process!
Final Fix for the "ewpage" Issue
After examining the combined markdown file, I've found the true source of the persistent "ewpage" issue. The
ewpage
text appears right after each page break in the combined file, showing that there's still a problematic segment in the build process.What I Found in the Combined File
The pattern in the combined file shows:
This pattern repeats throughout the combined document, confirming that something in the build process is still adding this text despite our previous fixes.
The Complete Solution
I've implemented a more comprehensive fix to the
combine-markdown.sh
script:Completely removed all additional page breaks for files that already have them in their source. This eliminates any chance of malformed page break commands being introduced.
Only add HTML-style page breaks to appendices and glossary files if they don't already have them, and use a consistent approach with HTML-style breaks that are compatible with all output formats.
Added checks to avoid adding redundant page breaks if files already contain them.
This approach:
What to Expect
The next book build should have:
This should resolve the issue completely. Let me know if you encounter any other problems with the build process!