https://github.com/simc/quill-delta-dart
https://github.com/simc/quill-delta-dart
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/simc/quill-delta-dart
- Owner: simc
- License: bsd-3-clause
- Created: 2022-07-25T14:55:59.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-07-25T14:56:02.000Z (almost 4 years ago)
- Last Synced: 2024-10-19T07:54:26.623Z (over 1 year ago)
- Language: Dart
- Size: 73.2 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://www.travis-ci.com/pulyaevskiy/quill-delta-dart) [](https://codecov.io/gh/pulyaevskiy/quill-delta-dart) [](https://pub.dev/packages/quill_delta)
Implementation of Quill editor Delta format in Dart. Refer to official
[documentation][] for more details.
[documentation]: https://quilljs.com/docs/delta/
## Usage
```dart
import 'package:quill_delta/quill_delta.dart';
void main() {
var doc = new Delta()..insert('Hello world', {'h': '1'});
var change = new Delta()
..retain(6)
..delete(5)
..insert('Earth');
var result = doc.compose(change);
print('Original document:\n$doc\n');
print('Change:\n$change\n');
print('Updated document:\n$result\n');
/// Prints:
///
/// Original document:
/// ins⟨Hello world⟩ + {h: 1}
///
/// Change:
/// ret⟨6⟩
/// ins⟨Earth⟩
/// del⟨5⟩
///
/// Updated document:
/// ins⟨Hello ⟩ + {h: 1}
/// ins⟨Earth⟩
}
```
## Features and bugs
Please file feature requests and bugs at the [issue tracker][tracker].
[tracker]: https://github.com/pulyaevskiy/quill-delta-dart/issues