Skip to content
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

Added text editor and implemented it in some cases (#122) #181

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Rahuldeb5
Copy link
Contributor

This doesn't 100% fix #122 but it implements a basic text editor and uses it in the most simplest of cases.

To do:

  • Add more features (It just didn't work for me i don't know why; I tried installing more but it just didn't work). So far only works for lists, bold, and italics. Links and colors don't work.
  • Add it in more complicated cases like descriptions for meetings

@Rahuldeb5 Rahuldeb5 requested a review from TheEgghead27 July 31, 2024 15:17
Copy link

netlify bot commented Jul 31, 2024

Deploy Preview for stuyepsilon ready!

Name Link
🔨 Latest commit 254e15a
🔍 Latest deploy log https://app.netlify.com/sites/stuyepsilon/deploys/66aa55855e1cb1000884e19e
😎 Deploy Preview https://deploy-preview-181--stuyepsilon.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@TheEgghead27 TheEgghead27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not willing to approve this PR just yet, as there is no back-end sanitization of code (so someone could inject evil scripts in an XSS attack)
Further, we should discuss how to format these HTML contents for our plaintext emails, I see two possibilities

  • Keeping our emails plaintext, but extracting the plaintext of the HTML (or using Markdown or some other human-friendly syntax in emails) (I prefer this, because it marginally improves our spam rating, and reduces the odds of email formatting errors)
  • Using HTML in our emails (increases complexity and chances of being spam-canned, and would need additional effort to look nice)

@@ -184,7 +184,11 @@ const OrgChat = ({ organization_id }: { organization_id: number }) => {
</Typography>
{/* Add a break or any other separator as needed */}
<br />
{message.content}
<div
dangerouslySetInnerHTML={{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scary!

>
{announcement.content}
</Typography>
dangerouslySetInnerHTML={{ __html: announcement.content }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concerning!

>
{announcement.content}
</Typography>
dangerouslySetInnerHTML={{ __html: announcement.content }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

𝓯𝓻𝓮𝓪𝓴𝔂

@TheEgghead27
Copy link
Member

My thoughts: do not implement the text editor for meetings/posts, which are emailed out in plaintext and should remain as such (to reduce complexity), but keep the editor where it is now (organization messages + announcements) where it may be useful to have.

However, before this PR is merged, XSS mitigations must be implemented on the backend for organization messages (announcements are not a likely attack vector because it is only writable by trusted administrators)

@TheEgghead27
Copy link
Member

If formatting for meetings/posts are desired, the editor should be adapted to emit Markdown, which will be sent in plaintext verbatim, and parsed to display (with a limited subset of, or no support at all for, embedded HTML)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

have an editor for posts
2 participants