A Rust port of Lexical's model and headless packages,
at parity with the JS implementation: the same documents give the same
editor state and the same JSON, byte for byte. The crate is lexical-ui. It's
developed in
wevm/lexical under rust/, and each
release is mirrored to wevm/lexical-rust;
CHANGELOG.md lists them.
use lexical_ui::{create_editor, get_root, CreateEditorArgs};
let editor = create_editor(CreateEditorArgs::default());
let state = editor.parse_editor_state(json)?;
let text = state.read(|| get_root().get_text_content());
let compact = state.to_json(true).to_string();- DESIGN.md: decisions, features per package, milestones.
- PARITY.md: what is ported, from which JS files, checked by which vectors, and the documented exceptions.
cargo run -p lexical-conformancereplays the conformance vectors thatpackages/lexical-conformancerecords from the JS packages.
MIT licensed, like Lexical.