-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add ToastUi editor for markdown elements #1368
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1368 +/- ##
==========================================
+ Coverage 92.19% 92.26% +0.06%
==========================================
Files 101 102 +1
Lines 2397 2418 +21
==========================================
+ Hits 2210 2231 +21
Misses 187 187 ☔ View full report in Codecov by Sentry. |
Add styles to ensure the editor preview matches the final output. Co-authored-by: Julia Casamitjana <[email protected]>
The default ToastUI image insertion feature includes both URL and file upload options. However, file upload functionality isn't supported in the application. This commit addresses the issue by implementing custom code to hide the file upload button while preserving the URL insertion option. Co-authored-by: Julia Casamitjana <[email protected]>
The editor will now have a default height of 300px but a button will let the user expand the editor. It will expand it to fit all content (or up to 400px if the content was not exceeding 300px). In the expanded mode the editor will keep growing as the user types more content. Co-authored-by: Julia Casamitjana <[email protected]>
Manually inserting a codeblock adding three backticks and hitting enter is not functioning in the ToastUI editor due to an existing bug in the library. This commit implements a workaround to address the issue. Co-authored-by: Julia Casamitjana <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good to me! Thank you also for your kind words of appreciation! 😊
What does this change?
This PR integrates the ToastUi library and uses it in all forms where markdown editors are required (task descriptions and collection descriptions). Hence, this PR relates to #1114 and improves the editor experience for those attributes currently relying on Markdown. All code changes are based on the great work done by @JuliaCasamitjana with openHPI/codeocean#2242.
Note: There are three open bugs affecting the ToastUI preview:
referenceDefinition
to support such links breaks the preview functionality. It has to be disabled.Current behaviour with such bugs:
Decisions / Choices we made
markdown-it
) and replacing the contents of the toastUi preview accordingly on the fly. We did not include this workaround, but implementing a similar solution here wouldn't require significant additional effort if we prefer to adopt this somewhat hacky approach.```
. The last commit ef77c47 implements a workaround for this bug.