[GH-ISSUE #1052] Unable to open epub version of book in ClearView #4297

Open
opened 2026-04-19 12:17:07 -05:00 by GiteaMirror · 8 comments
Owner

Originally created by @arulk on GitHub (Nov 25, 2025).
Original GitHub issue: https://github.com/harvard-edge/cs249r_book/issues/1052

Originally assigned to: @profvjreddi on GitHub.

When I try to open the epub version of the book, get the following error.

thank
-arul

This page contains the following errors:

error on line 24208 at column 19: Comment must not contain '--' (double-hyphen)
error on line 24213 at column 18: Comment must not contain '--' (double-hyphen)
error on line 24216 at column 19: Comment must not contain '--' (double-hyphen)
Below is a rendering of the page up to the first error.

Originally created by @arulk on GitHub (Nov 25, 2025). Original GitHub issue: https://github.com/harvard-edge/cs249r_book/issues/1052 Originally assigned to: @profvjreddi on GitHub. When I try to open the epub version of the book, get the following error. thank -arul This page contains the following errors: error on line 24208 at column 19: Comment must not contain '--' (double-hyphen) error on line 24213 at column 18: Comment must not contain '--' (double-hyphen) error on line 24216 at column 19: Comment must not contain '--' (double-hyphen) Below is a rendering of the page up to the first error.
GiteaMirror added the area: booktype: bugformat: epub labels 2026-04-19 12:17:07 -05:00
Author
Owner

@profvjreddi commented on GitHub (Nov 25, 2025):

Hi @arulk could you please tell me what reader you are using? It seems to be working ok on the apple reader.

<!-- gh-comment-id:3573942071 --> @profvjreddi commented on GitHub (Nov 25, 2025): Hi @arulk could you please tell me what reader you are using? It seems to be working ok on the apple reader.
Author
Owner

@profvjreddi commented on GitHub (Nov 25, 2025):

Ooh nevermind you literally told me it was ClearView 🤦 Thanks, will look into it.

<!-- gh-comment-id:3574071533 --> @profvjreddi commented on GitHub (Nov 25, 2025): Ooh nevermind you literally told me it was ClearView 🤦 Thanks, will look into it.
Author
Owner

@profvjreddi commented on GitHub (Nov 25, 2025):

The fix for this issue has been implemented in commit 040b95ef0 on the dev branch.

What was fixed

The EPUB XML parsing errors were caused by CSS custom properties (variables like --crimson, --text-primary) containing double-hyphens, which violate XML comment specifications. All 66 instances of CSS variables in epub.css have been replaced with their literal hex color values.

Next steps

The fix is currently in the dev branch and needs to be:

  1. Merged to main
  2. Released as a new version (e.g., v0.4.3)

Once a new release is published, the EPUB should open correctly in ClearView and other strict XML readers.

For immediate testing

If you want to test the fix before the official release, you can build from the dev branch.

<!-- gh-comment-id:3575711851 --> @profvjreddi commented on GitHub (Nov 25, 2025): The fix for this issue has been implemented in commit 040b95ef0 on the `dev` branch. ## What was fixed The EPUB XML parsing errors were caused by CSS custom properties (variables like `--crimson`, `--text-primary`) containing double-hyphens, which violate XML comment specifications. All 66 instances of CSS variables in `epub.css` have been replaced with their literal hex color values. ## Next steps The fix is currently in the `dev` branch and needs to be: 1. Merged to `main` 2. Released as a new version (e.g., v0.4.3) Once a new release is published, the EPUB should open correctly in ClearView and other strict XML readers. ## For immediate testing If you want to test the fix before the official release, you can build from the `dev` branch.
Author
Owner

@profvjreddi commented on GitHub (Nov 25, 2025):

Update: The fix has now been actually implemented in commit d85278f87 on the dev branch.

What was fixed

The EPUB XML parsing errors were caused by CSS custom properties (variables like --crimson, --text-primary) containing double-hyphens, which violate XML comment specifications in strict XML parsers.

Solution applied:

  • Removed the :root CSS variable definitions block
  • Replaced all 66 instances of var() references with their literal hex color values
  • Added documentation explaining why variables cannot be used in EPUB
  • Maintained a color reference guide for future maintenance

Verification

# No more CSS variables in epub.css
grep "var(--" quarto/assets/styles/epub.css  # Returns nothing
grep "^\s*--" quarto/assets/styles/epub.css  # Returns nothing

Next steps

The fix is currently in the dev branch and needs to be:

  1. Merged to main
  2. Released as a new version (e.g., v0.4.3)

Once a new release is published, the EPUB should open correctly in ClearView and other strict XML readers.

For immediate testing

If you want to test the fix before the official release, you can build from the dev branch.

Note

Commit 040b95ef0 had the correct commit message but contained no actual file changes (empty commit). The actual fix is now in commit d85278f87.

<!-- gh-comment-id:3575723577 --> @profvjreddi commented on GitHub (Nov 25, 2025): **Update:** The fix has now been **actually implemented** in commit d85278f87 on the `dev` branch. ## What was fixed The EPUB XML parsing errors were caused by CSS custom properties (variables like `--crimson`, `--text-primary`) containing double-hyphens, which violate XML comment specifications in strict XML parsers. **Solution applied:** - Removed the `:root` CSS variable definitions block - Replaced all 66 instances of `var()` references with their literal hex color values - Added documentation explaining why variables cannot be used in EPUB - Maintained a color reference guide for future maintenance ## Verification ```bash # No more CSS variables in epub.css grep "var(--" quarto/assets/styles/epub.css # Returns nothing grep "^\s*--" quarto/assets/styles/epub.css # Returns nothing ``` ## Next steps The fix is currently in the `dev` branch and needs to be: 1. Merged to `main` 2. Released as a new version (e.g., v0.4.3) Once a new release is published, the EPUB should open correctly in ClearView and other strict XML readers. ## For immediate testing If you want to test the fix before the official release, you can build from the `dev` branch. ## Note Commit `040b95ef0` had the correct commit message but contained no actual file changes (empty commit). The actual fix is now in commit `d85278f87`.
Author
Owner

@arulk commented on GitHub (Nov 25, 2025):

Thanks . I will test the fix when it is merged in main.

<!-- gh-comment-id:3576231669 --> @arulk commented on GitHub (Nov 25, 2025): Thanks . I will test the fix when it is merged in main.
Author
Owner

@profvjreddi commented on GitHub (Nov 27, 2025):

@arulk Could you please try the epub here: https://harvard-edge.github.io/cs249r_book_dev/

This is the development website, and want to know if the ePub there works as I fixed some issues based on your feedback.

<!-- gh-comment-id:3585670109 --> @profvjreddi commented on GitHub (Nov 27, 2025): @arulk Could you please try the epub here: https://harvard-edge.github.io/cs249r_book_dev/ This is the development website, and want to know if the ePub there works as I fixed some issues based on your feedback.
Author
Owner

@arulk commented on GitHub (Nov 30, 2025):

I am still getting the same error

This page contains the following errors:

error on line 24243 at column 19: Comment must not contain '--' (double-hyphen)
error on line 24248 at column 18: Comment must not contain '--' (double-hyphen)
error on line 24251 at column 19: Comment must not contain '--' (double-hyphen)
Below is a rendering of the page up to the first error.

<!-- gh-comment-id:3592108276 --> @arulk commented on GitHub (Nov 30, 2025): I am still getting the same error This page contains the following errors: error on line 24243 at column 19: Comment must not contain '--' (double-hyphen) error on line 24248 at column 18: Comment must not contain '--' (double-hyphen) error on line 24251 at column 19: Comment must not contain '--' (double-hyphen) Below is a rendering of the page up to the first error.
Author
Owner

@profvjreddi commented on GitHub (Nov 30, 2025):

Thanks I am able to see the error now, will try to dig into it! 🤓

<!-- gh-comment-id:3593134627 --> @profvjreddi commented on GitHub (Nov 30, 2025): Thanks I am able to see the error now, will try to dig into it! 🤓
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/cs249r_book#4297