hero_books: PDF export renders raw HTML instead of PDF #21

Closed
opened 2026-03-11 19:16:53 +00:00 by mik-tf · 1 comment
Owner

Bug

The /pdf/{id} route in hero_books_ui renders the raw HTML source of the markdown page instead of converting it to an actual PDF document.

Steps to Reproduce

  1. Run make demo in hero_books
  2. Open a book page in the UI
  3. Click the PDF export/download link
  4. Browser shows raw HTML tags (<meta>, <div>, etc.) instead of a formatted PDF

Expected

The PDF route should render the markdown content as a properly formatted PDF document.

Screenshot

URL: localhost:8080/pdf/1174b68654ca2719 shows raw HTML source code in the PDF viewer.

Repo

  • lhumina_code/hero_bookscrates/hero_books_ui/ (the Bootstrap UI)
## Bug The `/pdf/{id}` route in hero_books_ui renders the raw HTML source of the markdown page instead of converting it to an actual PDF document. ### Steps to Reproduce 1. Run `make demo` in hero_books 2. Open a book page in the UI 3. Click the PDF export/download link 4. Browser shows raw HTML tags (`<meta>`, `<div>`, etc.) instead of a formatted PDF ### Expected The PDF route should render the markdown content as a properly formatted PDF document. ### Screenshot URL: `localhost:8080/pdf/1174b68654ca2719` shows raw HTML source code in the PDF viewer. ### Repo - `lhumina_code/hero_books` — `crates/hero_books_ui/` (the Bootstrap UI)
Author
Owner

Fixed in hero_books PR #81 (merged).

  • to_raw_url() auto-converts forge /src/branch/ and GitHub /blob/ URLs to raw
  • HTML responses detected and rejected with clear error message
Fixed in hero_books PR #81 (merged). - `to_raw_url()` auto-converts forge `/src/branch/` and GitHub `/blob/` URLs to raw - HTML responses detected and rejected with clear error message
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/home#21
No description provided.