-
Notifications
You must be signed in to change notification settings - Fork 426
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
Rich text editor component ( markdown + mentions + fileuploads) #8070
Conversation
@UdaySagar-Git is attempting to deploy a commit to the Open Healthcare Network Team on Vercel. A member of the Team first needs to authorize it. |
✅ Deploy Preview for care-egov-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@gigincg @khavinshankar built a text editor from scratch. If this is okay, I will improve the styling and integrate it with doctor's notes. |
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.
@UdaySagar-Git Nicely done, the code is well broken down into functions and well written. Here are some pointers to be noted:
document.addEventListener("selectionchange", handleSelectionChange); | ||
return () => { | ||
document.removeEventListener("selectionchange", handleSelectionChange); |
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.
Currently, event listeners are added on the document, consider adding them to editor
const turndownService = new TurndownService(); | ||
const htmlContent = editorRef.current?.innerHTML || ""; | ||
const markdownText = turndownService.turndown(htmlContent); | ||
setMarkdown(markdownText); | ||
setHtmlCode(htmlContent); |
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.
Currently, we are styling in HTML, converting it into markdown and then again we are converting it back into HTML. Why not directly edit markdown? Look into the feasibility of doing this.
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.
hmm.. if there is no requirement of live preview (for example showing stars * *) for bold while editing similar to github comments , then i will go for directly editing the markdown and preview as html
👋 Hi, @UdaySagar-Git, This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there. |
👋 Hi, @UdaySagar-Git, This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there. |
Hi, This pr has been automatically marked as stale because it has not had any recent activity. It will be automatically closed if no further activity occurs for 7 more days. Thank you for your contributions. |
Closing as superseded by #8016 |
Proposed Changes
This pr is a follow up of #8016
turndown
to convert html to markdowncreated a temporary /test route which will be removed after review
@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers