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

Add button to copy code in markdown #1845

Merged
merged 1 commit into from Feb 25, 2023
Merged

Add button to copy code in markdown #1845

merged 1 commit into from Feb 25, 2023

Conversation

Slowlife01
Copy link
Contributor

@Slowlife01 Slowlife01 commented Feb 24, 2023

Resolves #1814

image
image

Not sure if using Toast is a bit too much but I think it fits the style

website/src/components/Messages/RenderedMarkdown.tsx Outdated Show resolved Hide resolved
@@ -36,6 +38,7 @@ const sx: SystemStyleObject = {
bg: "gray.300",
p: 0.5,
borderRadius: "2px",
marginRight: "40px",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also why you need marginRight here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't want the button to be hiding some text

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe show the button when hover only like GitHub does, or maybe add margin to the code element only?

Copy link
Collaborator

Choose a reason for hiding this comment

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

also please try inset-block-end or inset-inline-end instead of margin-right for RTL languages.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

or maybe add margin to the code element only?

Is this not the right place to put it?

image


also please try inset-block-end or inset-inline-end instead of margin-right for RTL languages

image
Would this work instead? The inset-block-end and inset-inline-end don't seem to work for me

image
Also, is this how it's supposed to look like?

@github-actions
Copy link

pre-commit failed.
Please run pre-commit run --all-files locally and commit the changes.
Find more information in the repository's CONTRIBUTING.md

@github-actions
Copy link

pre-commit failed.
Please run pre-commit run --all-files locally and commit the changes.
Find more information in the repository's CONTRIBUTING.md

1 similar comment
@github-actions
Copy link

pre-commit failed.
Please run pre-commit run --all-files locally and commit the changes.
Find more information in the repository's CONTRIBUTING.md

@Slowlife01
Copy link
Contributor Author

Something gone wrong there. Super sorry

Copy link
Collaborator

@notmd notmd left a comment

Choose a reason for hiding this comment

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

Thank you so much

@notmd notmd merged commit 188010c into LAION-AI:main Feb 25, 2023
@Slowlife01 Slowlife01 deleted the clipboard branch March 19, 2023 04:53
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.

Allow to copy code in markdown
3 participants