-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(neon_rich_text): Render markdown #2647
base: main
Are you sure you want to change the base?
feat(neon_rich_text): Render markdown #2647
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2647 +/- ##
==========================================
+ Coverage 28.88% 28.95% +0.06%
==========================================
Files 373 373
Lines 138192 138327 +135
==========================================
+ Hits 39922 40057 +135
Misses 98270 98270
*This pull request uses carry forward flags. Click here to find out more.
|
So we don't forget it. |
Yeah let's do that, this feature is getting too big by now. |
d7d7f8e
to
9726cc8
Compare
Moving to a separate package and the cleanups got to big, so I split that off into #2682. |
I didn't add any tests yet and the code in this PR also has to be refactored before a proper review can take place. |
beb47f5
to
1338a06
Compare
9726cc8
to
1809b1f
Compare
cdd12ad
to
0a3aa4c
Compare
1809b1f
to
5f94b6f
Compare
Just a rebase for neon_rich_text, nothing new or tests added. |
5f94b6f
to
dcdcc0d
Compare
I implemented all tests from https://github.com/nextcloud-libraries/nextcloud-vue/blob/master/cypress/component/richtext.cy.ts plus a few that are simply missing in those tests but are working in the web interface and are implemented by us. I think this is the perfect use-case for using flutter goldens to ensure the rendering is exactly as expected. Proper fonts had to be used in order to make sure the results are correct. Let's hope the font rendering is consistent... |
cc67f17
to
d85fea4
Compare
I agree. Can you please make a separate PR for the two fixes? This is already a quite big one. |
d85fea4
to
3c24ecf
Compare
Done, but the second fix is required for this PR so I based this PR on it. |
3c24ecf
to
055a2e4
Compare
(Put it in draft to avoid accidentally merging it into the other branch) |
This likely needs a rebase for #2703 as the rendering might have changed slightly. |
Signed-off-by: provokateurin <kate@provokateurin.de>
055a2e4
to
2bef616
Compare
Closes #1929
Just like the emoji picker I thought it would be much harder, but it was not too bad (but still quite a lot of effort, especially the final newline handling as you will see).
This is a fully custom rendering implementation for markdown including rich objects.
Using https://pub.dev/packages/flutter_markdown was not an option because it does not expose the necessary low level APIs to implement everything we need.
I mostly tested this manually with the example from https://markdown-it.github.io.
This likely implements some things that are actually not supported in Talk right now,
I did not write proper tests for the rendering itself (but there is on Talk test that ensures markdown is rendered when requested). There are multiple viable sources we can use to cover the tests:
IMO option 3 is the best right now, because it will strike a good balance between effort and coverage. Anything not covered by these tests should not ever appear in a Talk message so we should be good.
While writing this I realized I never tested check boxes and they are not implemented either. In Talk there is this cool feature where a click on a checkbox will toggle it and actually edit the message. Implementing that will probably not be easy, so I would like to skip it for now and open a new issue for it once this is merged.
This isn't finished completely, because I first wanted to discuss the general direction before putting even more effort into this.