Comments Don't Support New Lines #274
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
https://maps.strafes.net/mapfixes/80
You can see in my comment on this fix that I wrote the comment with new lines in mind in the comment box, but when posted it sent as one big paragraph instead of keeping the new lines i created
You can see that it's saved correctly into the database here: https://maps.strafes.net/api/mapfixes/80/audit-events?Page=1&Limit=100
So it's just being displayed incorrectly by whatever JavaScript powers that be. The exact line of code responsible for the comment text is right here:
decodeAuditEvent(event). There is probably some sort of HTML attribute for Typography that makes it not be stupid. Maybe search for "Material UI Typography newlines" or something. A quick websearch yields the display attribute with a couple possible values to try beingdisplay="block"ordisplay="inline", I have no idea where the specific documentation for that is though.After some searching apparents adding
style={{whiteSpace: 'pre-line'}}inside the<Typography ... >allows \n to be rendered correctly. I have no clue how to test this in the website code so I am going to leave that to someone else to do (sorry).See https://github.com/mui/material-ui/issues/9189
Follow the README.md instructions for the website and point it to the staging backend using a file named
.env:After it's running (
bun run dev) you should be able to use it in your browser at http://localhost:8080I'm pretty sure it even supports hot reloading so you can make changes to the javascript code in real time
#289