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

Fix the whitespace css #26

Closed
kossel opened this issue Jul 26, 2022 · 5 comments
Closed

Fix the whitespace css #26

kossel opened this issue Jul 26, 2022 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@kossel
Copy link

kossel commented Jul 26, 2022

What feature would you like to see added?
First appreciated doing this! Spaces that are added in reviews are not handled on the new review page. it looks like this:

image

The fix is easy, just need to add white-space: pre-wrap CSS to the container div. Since you are using Tailwind you can just add whitespace-pre-wrap class to this line

PS:
I could've open a PR but it still missing proper dev/contribution documentation, also seems this repo doesn't accept public PRs

Additional context
after fix:
image

@kossel kossel added the enhancement New feature or request label Jul 26, 2022
@m4ttsch
Copy link
Contributor

m4ttsch commented Jul 26, 2022

Hey! Thanks for adding.

I think the larger feature here is that these reviews have markdown content in them, which ideally I would like to parse using something like React Markdown. That way, I would get headers from "##", lists from "-" and italics from "_".

If you are interested, I would very much welcome a PR that adds the full markdown functionality. You should be able to fork and then open up a PR against the repo, but let me know if you have issues.

Right now, my main focus is adding functionality so that students can write reviews in a simple, authenticated, identifiable manner.

@kossel
Copy link
Author

kossel commented Jul 27, 2022

Hi

I agree to parse the md format is definitely a better idea, but that might take longer. I just wanted to provide a quick fix (probably takes 1 min for you) to make it readable right the way.

I am not sure about the future of this project nor your plan, but if your intention is to make it open sourced or community based probably you could add quick dev documentation. pretty sure there are people that are willing to help

I cloned the repo but it won't run because Sanity config not found.

@m4ttsch
Copy link
Contributor

m4ttsch commented Jul 27, 2022

@kossel Take a look at the PR (and site preview) above. Let me know your thoughts.

The implementation is pretty easy. I use ReactMarkdown to render the content, and Tailwind's prose styling to get some nice default styles.

One thing to note. Markdown allows raw HTML content which means that we start to open ourselves up to XSS attacks. Rehype-Sanitize has us covered here.

@kossel
Copy link
Author

kossel commented Jul 27, 2022

@m4ttsch Hi, thanks for knocking down this so quickly!! the PR seems fairly straightforward, I don't have any concerns.

@m4ttsch
Copy link
Contributor

m4ttsch commented Jul 27, 2022

Merged!

@m4ttsch m4ttsch closed this as completed Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants