Fix broken payment/checkout page #17

Merged
will.anderson merged 2 commits from fix/payment-page-heredoc-escape into dev 2026-05-09 18:14:17 +00:00
Owner

elc's heredoc parser treats <html> as an opener and scans forward for </html>, which lives inside page_close's return statement. This injected the entire El source of page_close verbatim into page_open's output, which terminated the document before Stripe's scripts could load — breaking the payment page completely.

Root cause: cross-function heredoc span. elc opens a heredoc at <html lang="en"> in page_open and scans forward to find the matching </html>, picking it up from page_close's return widgets + "</body></html>".

Fix:

  • Put <!DOCTYPE html><html lang="en"> in a quoted string literal — not a heredoc
  • <head>...</head> is the only heredoc in page_open, and it closes within the same function
  • Stub page_close in styles.el as extern fn so dist/page_close.c supplies the pre-compiled definition (avoiding the second duplicate-symbol link failure)
  • Fix broken hyphenated attributes in dist/page_close.c: aria-label, stroke-width, stroke-linecap, &times;, and several text nodes that had whitespace stripped by elc's heredoc parser

Verified locally: all 13 checks pass (no El source in output, correct document structure, Stripe script present, all HTML attributes intact).

elc's heredoc parser treats `<html>` as an opener and scans forward for `</html>`, which lives inside page_close's return statement. This injected the entire El source of page_close verbatim into page_open's output, which terminated the document before Stripe's scripts could load — breaking the payment page completely. **Root cause**: cross-function heredoc span. elc opens a heredoc at `<html lang="en">` in page_open and scans forward to find the matching `</html>`, picking it up from page_close's `return widgets + "</body></html>"`. **Fix**: - Put `<!DOCTYPE html><html lang="en">` in a quoted string literal — not a heredoc - `<head>...</head>` is the only heredoc in page_open, and it closes within the same function - Stub `page_close` in styles.el as `extern fn` so `dist/page_close.c` supplies the pre-compiled definition (avoiding the second duplicate-symbol link failure) - Fix broken hyphenated attributes in dist/page_close.c: `aria-label`, `stroke-width`, `stroke-linecap`, `&times;`, and several text nodes that had whitespace stripped by elc's heredoc parser Verified locally: all 13 checks pass (no El source in output, correct document structure, Stripe script present, all HTML attributes intact).
will.anderson added 1 commit 2026-05-09 17:57:13 +00:00
Fix broken payment page: escape html/body heredocs in page_open
Dev — Build & local smoke test / build-smoke (pull_request) Failing after 1m27s
7f27f4be9f
elc's heredoc parser treats <html> as an opener and scans forward for
</html>, which exists inside page_close's return statement. This caused
the entire El source of page_close to be injected verbatim into the
page_open output string, terminating the document before Stripe scripts
could load.

Fix: put <!DOCTYPE html><html lang="en"> in a quoted string literal
and use <head>...</head> as the sole heredoc in page_open — closes
within the same function, no cross-boundary scanning. Stub page_close
in styles.el as extern fn so dist/page_close.c supplies the definition.

Also fix elc-broken hyphenated attributes in dist/page_close.c:
aria-label, stroke-width, stroke-linecap, &times;, and several
text nodes that had whitespace stripped by the heredoc parser.
will.anderson added 1 commit 2026-05-09 18:07:16 +00:00
Convert page_open to native El; fix corrupted CSS
Dev — Build & local smoke test / build-smoke (pull_request) Failing after 1m57s
90609c7aaf
elc's heredoc tokenizer was corrupting the inline CSS:
- #FAFAF8 -> FAFAF8 (# treated as comment character)
- 'Playfair Display' -> PlayfairDisplay (quotes + space stripped)
- padding: 0 2.5rem -> padding:02.5rem (spaces between tokens stripped)

The CSS and other complex head content (GA script, JSON-LD schema)
have been pre-compiled to C functions (page_css, page_ga_script,
page_schema) so they bypass the tokenizer entirely and are stored as
properly-escaped C string literals.

page_head() now assembles the <head> content using el-html vessel
calls (el_meta_charset, el_meta, el_title, el_link_stylesheet, etc.)
plus string literals for the vessel gaps. page_open() returns the
complete document prologue as a string concatenation with no heredocs.

page_close() remains pre-compiled in dist/page_close.c (unchanged).
will.anderson merged commit b39977b74c into dev 2026-05-09 18:14:17 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: neuron-technologies/neuron-web#17