[PR #1026] [MERGED] fix(epub): ensure XHTML compliance in frontmatter files #7935

Closed
opened 2026-04-27 17:11:56 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/harvard-edge/cs249r_book/pull/1026
Author: @profvjreddi
Created: 11/3/2025
Status: Merged
Merged: 11/3/2025
Merged by: @profvjreddi

Base: devHead: 1014-ebook-in-epub-format-fails-to-load-displays-errors


📝 Commits (2)

  • 7459a91 fix(epub): ensure XHTML compliance in frontmatter files
  • 2d9a092 Merge branch 'dev' into 1014-ebook-in-epub-format-fails-to-load-displays-errors

📊 Changes

6 files changed (+27 additions, -25 deletions)

View changed files

📝 quarto/_quarto.yml (+1 -1)
📝 quarto/contents/frontmatter/acknowledgements/acknowledgements.qmd (+16 -10)
📝 quarto/contents/frontmatter/changelog/changelog.qmd (+2 -2)
📝 quarto/contents/frontmatter/foreword.qmd (+2 -8)
📝 quarto/contents/frontmatter/index.qmd (+2 -0)
📝 quarto/contents/frontmatter/socratiq/socratiq.qmd (+4 -4)

📄 Description

Summary

This PR fixes EPUB XML parsing errors caused by JavaScript, iframes, and complex HTML in frontmatter files.

Changes

  • **Replace with ** to properly exclude EPUB from JavaScript content
  • Add conditional content blocks with helpful fallback messages for EPUB/PDF readers
  • Fix foreword.qmd to use native Quarto div syntax instead of raw HTML
  • Standardize logo sizes (150px-200px) for consistent appearance across formats
  • Update SocratiQ paper link with full title for better academic citation
  • Improve acknowledgements message to emphasize continuously evolving contributor list

Files Modified

    • Conditional contributors table, sized logos, improved message
    • Conditional interactive features, full paper title
    • Fixed to use html:js
    • Conditional GitHub iframe
    • Native Quarto syntax for italic styling

Testing

  • All pre-commit hooks passed
  • EPUB build should now work without XML parsing errors
  • Fallback messages provide clear guidance to non-HTML format readers

Closes #1014

Co-authored-by: @bluebaer7


Note

Enables EPUB-safe builds by switching to EPUB config, gating JS/iframes to HTML-only, standardizing image sizes, and cleaning frontmatter markup/links.

  • Build config:
    • Switch Quarto include to config/_quarto-epub.yml in quarto/_quarto.yml.
  • Frontmatter content (EPUB compliance):
    • Gate JS/iframes behind when-format="html:js" and add unless-format="html:js" fallbacks in acknowledgements.qmd, changelog.qmd, index.qmd, and socratiq.qmd.
    • Convert raw HTML styling in foreword.qmd to native Quarto div syntax.
    • Standardize sponsor/logo image widths (150–200px) in acknowledgements.qmd.
    • Update SocratiQ paper references to full title and add clearer online-only messaging.

Written by Cursor Bugbot for commit 2d9a092f8d. This will update automatically on new commits. Configure here.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/harvard-edge/cs249r_book/pull/1026 **Author:** [@profvjreddi](https://github.com/profvjreddi) **Created:** 11/3/2025 **Status:** ✅ Merged **Merged:** 11/3/2025 **Merged by:** [@profvjreddi](https://github.com/profvjreddi) **Base:** `dev` ← **Head:** `1014-ebook-in-epub-format-fails-to-load-displays-errors` --- ### 📝 Commits (2) - [`7459a91`](https://github.com/harvard-edge/cs249r_book/commit/7459a912e0c8335cd781679d921c940dc0c0b921) fix(epub): ensure XHTML compliance in frontmatter files - [`2d9a092`](https://github.com/harvard-edge/cs249r_book/commit/2d9a092f8d97bfacc14d566444cae621fe05e2ec) Merge branch 'dev' into 1014-ebook-in-epub-format-fails-to-load-displays-errors ### 📊 Changes **6 files changed** (+27 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `quarto/_quarto.yml` (+1 -1) 📝 `quarto/contents/frontmatter/acknowledgements/acknowledgements.qmd` (+16 -10) 📝 `quarto/contents/frontmatter/changelog/changelog.qmd` (+2 -2) 📝 `quarto/contents/frontmatter/foreword.qmd` (+2 -8) 📝 `quarto/contents/frontmatter/index.qmd` (+2 -0) 📝 `quarto/contents/frontmatter/socratiq/socratiq.qmd` (+4 -4) </details> ### 📄 Description ## Summary This PR fixes EPUB XML parsing errors caused by JavaScript, iframes, and complex HTML in frontmatter files. ## Changes - **Replace with ** to properly exclude EPUB from JavaScript content - **Add conditional content blocks** with helpful fallback messages for EPUB/PDF readers - **Fix foreword.qmd** to use native Quarto div syntax instead of raw HTML - **Standardize logo sizes** (150px-200px) for consistent appearance across formats - **Update SocratiQ paper link** with full title for better academic citation - **Improve acknowledgements message** to emphasize continuously evolving contributor list ## Files Modified 1. - Conditional contributors table, sized logos, improved message 2. - Conditional interactive features, full paper title 3. - Fixed to use html:js 4. - Conditional GitHub iframe 5. - Native Quarto syntax for italic styling ## Testing - All pre-commit hooks passed - EPUB build should now work without XML parsing errors - Fallback messages provide clear guidance to non-HTML format readers Closes #1014 Co-authored-by: @bluebaer7 <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Enables EPUB-safe builds by switching to EPUB config, gating JS/iframes to HTML-only, standardizing image sizes, and cleaning frontmatter markup/links. > > - **Build config**: > - Switch Quarto include to `config/_quarto-epub.yml` in `quarto/_quarto.yml`. > - **Frontmatter content (EPUB compliance)**: > - Gate JS/iframes behind `when-format="html:js"` and add `unless-format="html:js"` fallbacks in `acknowledgements.qmd`, `changelog.qmd`, `index.qmd`, and `socratiq.qmd`. > - Convert raw HTML styling in `foreword.qmd` to native Quarto div syntax. > - Standardize sponsor/logo image widths (150–200px) in `acknowledgements.qmd`. > - Update SocratiQ paper references to full title and add clearer online-only messaging. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 2d9a092f8d97bfacc14d566444cae621fe05e2ec. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-27 17:11:56 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/cs249r_book#7935