-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Description This PR adds support for markdown / quill delta for regular feed posts ## Type of Change - [x] Bug fix - [x] New feature - [ ] Breaking change - [ ] Refactoring - [ ] Documentation - [ ] Chore ## Screenshots (if applicable) <img width="300" alt="image" src="https://github.com/user-attachments/assets/378bda29-bf58-42e3-9a26-8d97a16ff3c6" />
- Loading branch information
1 parent
0a3e202
commit 6f43f1d
Showing
22 changed files
with
207 additions
and
251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
lib/app/components/text_editor/utils/build_empty_delta.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// SPDX-License-Identifier: ice License 1.0 | ||
|
||
import 'package:flutter_quill/quill_delta.dart'; | ||
|
||
/// Creates new empty delta. | ||
/// All Quill documents must end with a newline character, | ||
/// even if there is no formatting applied to the last line. | ||
/// | ||
/// https://quilljs.com/docs/delta#line-formatting | ||
Delta buildEmptyDelta() { | ||
return Delta()..insert('\n'); | ||
} |
10 changes: 10 additions & 0 deletions
10
lib/app/components/text_editor/utils/is_attributed_operation.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// SPDX-License-Identifier: ice License 1.0 | ||
|
||
import 'package:flutter_quill/flutter_quill.dart'; | ||
import 'package:flutter_quill/quill_delta.dart'; | ||
|
||
bool isAttributedOperation(Operation operation, {required Attribute<dynamic> attribute}) { | ||
final attributes = operation.attributes; | ||
if (attributes == null) return false; | ||
return attributes.containsKey(attribute.key); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.