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

Markdown: Enable wrapping in code blocks and a color tweak #13894

Merged
merged 2 commits into from
Dec 9, 2020

Conversation

silverwind
Copy link
Member

  • Enable wrapping of long lines in code blocks like already done in code view.
  • Slightly lighten the background of code blocks on default theme.
  • Darken the background on inline code and kbd elements on arc-green.

Screen Shot 2020-12-07 at 23 11 14

Screen Shot 2020-12-07 at 23 11 23

- Enable wrapping of long lines in code blocks like already done in code
  view.
- Slightly lighten the background of code blocks on default theme
- Darken the background on inline code and kbd elements on arc-green
@silverwind silverwind added type/enhancement An improvement of existing functionality topic/ui Change the appearance of the Gitea UI labels Dec 7, 2020
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Dec 8, 2020
@6543
Copy link
Member

6543 commented Dec 8, 2020

@silverwind can we somehow indicate if it's an auto linebreak?

so you can see the difference between

echo hi this is a joke .......
rm -r -f data

and

echo hi this is NO joke .......
rm -r -f data

@silverwind
Copy link
Member Author

Hmm, I don't think it's possible to interact with forced linebreaks in CSS. Would probably be even hard to do in JS.

How would you want indicate it? Icon on the end of the line?

@6543
Copy link
Member

6543 commented Dec 9, 2020

... Icon on the end of the line?

not a bad idear - but if it will create thousand of js/css lines then forgett it

@lafriks
Copy link
Member

lafriks commented Dec 9, 2020

I don't think that's possible to add something like that

@lafriks lafriks added this to the 1.14.0 milestone Dec 9, 2020
@silverwind
Copy link
Member Author

Yeah, not easily possible. If we were to split each line into a <div> of its own, it may be possible with some advanced JS to detect wrapped lines, but I guess it'll be a bigger refactor and we'd want to also do that on the code view. Maybe something for later.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Dec 9, 2020
@6543 6543 merged commit 48dd0e2 into go-gitea:master Dec 9, 2020
@6543
Copy link
Member

6543 commented Dec 9, 2020

@silverwind thanks for the info :)

@silverwind silverwind deleted the mdtweaks branch December 9, 2020 14:31
@silverwind
Copy link
Member Author

silverwind commented Dec 9, 2020

For reference, something like https://github.com/xdamman/js-line-wrap-detector might be of use but it's a rather flimsy thing to do in JS and I'd certainly expect it to break on edge cases.

@go-gitea go-gitea locked and limited conversation to collaborators Jan 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/ui Change the appearance of the Gitea UI type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants