Skip to content

Storage, casting and rendering #4

Closed

Description

@n4ff4h

Store content as JSON, cast it on models, validate it per block, sanitize it, and render it server-side (Blade) and client-side (React).

Activity

  1. added
    next-genNext-gen Javaabu packages
    featurePackage feature from the spec
    on Nov 4, 2026
  2. n4ff4h commented on Nov 5, 2026

    @n4ff4h
    CollaboratorAuthor

    Done on main.

    • Storage: TipTap JSON in a json column, AsBlockDocument cast (sanitizes on set for its profile; reads Document, empty for null; serializes to the array for Inertia).
    • Validation: BlockContent rule (structure via content expressions, profile, marks, attribute rules, depth, required(), maxBlocks()). Errors go on the field (Block 3 (Button): …) and on the JSON path (body.content.2.attrs.url), which the editor shows on the block.
    • Sanitizing: unknown, disallowed and misplaced nodes and marks are dropped, attributes are cast, URLs are checked (including java\tscript:), and HTML blocks go through symfony/html-sanitizer. It runs on save and again on render.
    • Rendering: Blade views per block (<x-block-editor::content>, {{ $doc }}) and React BlockContent. Both are checked against the same fixtures in tests/Fixtures/content, so the markup is identical.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurePackage feature from the specnext-genNext-gen Javaabu packages

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions