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

Improvement: Markdown code block adjustments #308

Merged
merged 6 commits into from
Feb 17, 2025

Conversation

julian-wls
Copy link
Contributor

Problem Description

Code blocks in markdown text look different from the iOS and web app.

Changes

This PR changes the colors of the code blocks and adds rounded corners.

Steps for testing

Make sure the code block still looks good.

Further investigation

  • Note: Outside the scope of this PR, but worth discussing: I found a way to add a corner radius to images as well, but wrapContentSize is needed to make it work properly. Unfortunately, this caused some of the images in the chat to be too small. The approach was similar to clipping code blocks. Does anyone have an idea how to make this work? I would be happy to discuss this somewhere.
  • I found out, that there is a library available, that could enable syntax highlighting to code blocks. Would it be worth taking a look?

@julian-wls julian-wls self-assigned this Jan 16, 2025
@julian-wls julian-wls added the ready for review This PR can be reviewed label Jan 16, 2025
Copy link
Collaborator

@FelberMartin FelberMartin left a comment

Choose a reason for hiding this comment

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

Looks generally good to me

@FelberMartin
Copy link
Collaborator

I noticed that the rounded corners get applied to the whole posts that start with a code block. That leads to some inconsistencies, eg when there is a code block in the middle of a post, or when there is eg a trailing image.

First code block inside a post, the second one is in a standalone post. Notice the different corners:
image

Post starting with code block but with trailing image. Notice the inconsistent corners on the image (only bottom left corner is rounded)
image

@julian-wls
Copy link
Contributor Author

julian-wls commented Jan 17, 2025

I just noticed this, too. Let's put this PR on hold for now and discuss the details later. I think with a similar approach we can manage to apply the rounded corners correctly, maybe for images, too.

@FelberMartin FelberMartin removed the ready for review This PR can be reviewed label Jan 17, 2025
@FelberMartin FelberMartin self-requested a review January 17, 2025 08:40
@FelberMartin
Copy link
Collaborator

@julian-wls What is the status on this PR? In case you do not plan to work on this in the next week, I'd suggest to maybe close this PR for now and re-open it later, so we can keep the PR overview page clean 😅

@julian-wls
Copy link
Contributor Author

@julian-wls What is the status on this PR? In case you do not plan to work on this in the next week, I'd suggest to maybe close this PR for now and re-open it later, so we can keep the PR overview page clean 😅

Yes sure :) I'm going to revert the rounded corners for code blocks as this didn't lead anywhere so we only have the color adjustments and can put it back in review.

@julian-wls julian-wls added the ready for review This PR can be reviewed label Feb 14, 2025
Copy link
Collaborator

@FelberMartin FelberMartin left a comment

Choose a reason for hiding this comment

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

Just one code comment, good to merge from my side :)

@julian-wls julian-wls added ready to merge This PR can be merged and removed ready for review This PR can be reviewed labels Feb 17, 2025
@FelberMartin FelberMartin merged commit 3031204 into develop Feb 17, 2025
4 checks passed
@FelberMartin FelberMartin deleted the improvement/markdown-code-adjustments branch February 17, 2025 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge This PR can be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants