iksnae / actual-intelligence

A practical, non-technical guide to using AI tools like ChatGPT in everyday life
MIT License
0 stars 0 forks source link

Final fix for persistent "ewpage" issue #58

Open khaos-codi opened 3 months ago

khaos-codi commented 3 months ago

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:

  1. End of content from a markdown file
  2. The HTML page break that's in the original file
  3. A blank line
  4. The literal text "ewpage"
  5. 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:

  1. 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.

  2. 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.

  3. 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!