Skip to content

Refactor Quill to Extract Editor Core #52

@tmattio

Description

@tmattio

Background

Quill's editor logic is currently mixed with browser-specific code, making it difficult to test, reason about, and maintain. The document model, editing operations, and DOM manipulation are intertwined.

Objective

Extract an editor core that models the document and editing operations independently of the browser. This core should:

  • Handle document state and transformations
  • Manage cursor and selection logic
  • Provide editing operations (insert, delete, etc.)
  • Be testable without a browser

The web frontend will then use this core, translating between DOM events and core operations.

Design Considerations

Key areas to separate:

  • Document Model: Already partially exists in quill_markdown.ml, needs to be fully independent
  • Editor State: Cursor position, selection, editing mode
  • Operations: Insert text, delete, move cursor, etc. as pure functions
  • Browser Concerns: DOM manipulation, contenteditable quirks, event handling

Success Criteria

  • Editor core with no browser/DOM dependencies
  • Web frontend maintains all current functionality
  • Core logic is unit testable
  • Clear separation of concerns between core and web

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions