Implement support for big files and Markdown preview#4576
Open
TranceLove wants to merge 2 commits intoTeamAmaze:release/4.0from
Open
Implement support for big files and Markdown preview#4576TranceLove wants to merge 2 commits intoTeamAmaze:release/4.0from
TranceLove wants to merge 2 commits intoTeamAmaze:release/4.0from
Conversation
Member
|
Probably should add the images as part of the repo or use images with some assurance they won't break in the near future (wikimedia?). Second video in the description might be broken. |
7dde1d9 to
6d8b5ef
Compare
Uses Commonmark for Markdown parsing and rendering. Due to the way Commonmark works, it cannot support content streaming and update in realtime; user needs to let TextEditorActivity to load as much content as wish.
6d8b5ef to
41f0f13
Compare
Member
|
Should fix #1275. |
Collaborator
Author
|
Sidenote: when TextEditorActivity sees the file is big or in Markdown preview mode, it will be in readonly mode and you cannot save the file. Another story... need to think of a way to track the changed area in the big file which is not easy to do. Same goes to Markdown mode. I was just thinking of a way to conveniently read Markdowns on the move... |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implement support for big files and Markdown preview.
With this PR, sliding window is used for buffering big files to prevent OutOfMemory error.
out.mp4
The sliding window currently is set to 102400 characters.
Additionally, using https://github.com/commonmark/commonmark-java support for Markdown preview is also added.
Note however, due to the way Commonmark works that it doesn't support dynamically updating output HTML from InputStream, when switching to Markdown preview, it will only render what's inside the sliding window above, if file content is bigger than the sliding window.
Issue tracker
Automatic tests
Manual tests
Device: Fairphone 5
OS: LineageOS 23.2 (Android 16)
Build tasks success
Successfully running following tasks on local:
./gradlew assembledebug./gradlew spotlessCheck