I built a rich-text editor from scratch. No ProseMirror, no dependencies.
Описание и применение
Создан собственный WYSIWYG‑редактор Trevixal без внешних зависимостей, который можно встроить в любые приложения и экспортировать в множество форматов.
Задача
Developers often rely on existing rich-text engines (ProseMirror, Lexical, Slate, Quill, Draft.js) and want to understand the implications of building an editor without such dependencies.
Результат
Trevixal delivers a feature‑rich editor (tables, equations, diagrams, suggesting mode, theming, extensive exports) while remaining dependency‑free and embeddable.
Рабочий процесс
- 1. Define a JSON schema for documents.
- 2. Implement undo as inversion of edit steps.
- 3. Sanitize pasted HTML using an allowlist and test against attack payloads.
- 4. Expose UI via optional chrome package or adapters.
- 5. Export to multiple formats (HTML, Markdown, Word, PDF, etc.).
Доказательства
Trevixal is a WYSIWYG editor engine in about 60,000 lines of TypeScript and SCSS, with the document model, the undo system, the HTML sanitizer, the DOM renderer, the ZIP and XML writers behind Word export, and the LaTeX-to-MathML converter all written in this repository.
The core is headless. The chrome (menus, toolbar, dialogs) is a separate, optional package. There are adapters for React, Vue, Svelte and Angular, a web component, and an assembled "whole editor" you can mount in one call.
- Дата записи: 2026-10-22T10:26:08.765Z