Commit graph

8 commits

Author SHA1 Message Date
Snider
c525437ed6 refactor(module): migrate module path from forge.lthn.ai to dappco.re
Some checks failed
Security Scan / security (pull_request) Successful in 9s
Test / test (pull_request) Failing after 20s
Update module path from forge.lthn.ai/core/go-html to dappco.re/go/core/html.
Migrate all .go import paths, update dependency versions (core v0.5.0,
log v0.1.0, io v0.2.0), and add replace directives for local development.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 01:28:30 +00:00
Snider
e532c219b9 fix(dx): update CLAUDE.md size gate, sync Makefile limit, add coverage tests
All checks were successful
Security Scan / security (pull_request) Successful in 7s
Test / test (pull_request) Successful in 38s
- CLAUDE.md: correct WASM raw size gate from 3 MB to 3.5 MB (matches size_test.go)
- CLAUDE.md: document error handling (log.E) and file I/O (coreio.Local) conventions
- Makefile: sync WASM_RAW_LIMIT to 3670016 (3.5 MB) to match size_test.go
- Tests: add coverage for NewContextWithService, Attr through wrapper nodes,
  Unless(true), and Text.Render with i18n service — core package 95.8% → 99.4%

No fmt.Errorf or os.ReadFile/os.WriteFile violations found.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 08:21:15 +00:00
Snider
473fda5894 security: use html.EscapeString for XSS protection in rendering
All checks were successful
Security Scan / security (push) Successful in 9s
Test / test (push) Successful in 46s
Replace manual string-replace escaping with stdlib html.EscapeString.
Escape tag names and attribute keys in elNode and Layout rendering.
Improve Attr() to traverse wrapper nodes (If, Unless, Entitled).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 08:29:54 +00:00
Claude
9bc1fa7c69
fix: escape variant names, single-pass StripTags, WASM security contract
- Escape variant name in Responsive.Render HTML attribute (XSS fix)
- Rewrite StripTags to single-pass O(n) space collapsing
- Document Raw() security contract in WASM entry point
- Add TestAttr_NonElement coverage
- Fix Makefile WASM target to rebuild on source changes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 00:21:24 +00:00
Claude
f49ddbf374
feat: add Attr() helper for setting element attributes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 00:08:17 +00:00
Claude
c7240943d7
feat: add conditional, entitlement, switch, and each nodes
Implements If, Unless, Entitled, Switch, and Each (generic) control flow
nodes. Entitled uses deny-by-default when no entitlement function is set,
rendering absent content rather than hidden content. Each uses Go generics
for type-safe iteration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 23:36:54 +00:00
Claude
3e76e72cb7
feat: add Text node with go-i18n grammar pipeline
Introduces textNode that renders through go-i18n's T() function with
automatic HTML escaping for safe-by-default output. Adds escapeHTML
utility, NewContextWithService for explicit service binding, and
Entitlements field on Context for upcoming conditional rendering.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 23:35:50 +00:00
Claude
d7bb0b2b2c
feat: scaffold go-html module with Node interface
Introduces the go-html module with a Node rendering interface, Raw and El
constructors, void element handling, and attribute escaping. Includes a
minimal Context stub and tests for all node types.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 23:34:27 +00:00