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 monospace/code format does not work properly with linebreaks #308

Closed
Porrumentzio opened this issue Jun 18, 2021 · 11 comments · Fixed by #311
Closed

Markdown monospace/code format does not work properly with linebreaks #308

Porrumentzio opened this issue Jun 18, 2021 · 11 comments · Fixed by #311
Labels
bug Something isn't working

Comments

@Porrumentzio
Copy link

Issue Summary

Linebreaks are not kept when selecting multiple lines and clicking monospace formatting button. Doesn't mind if the linebreaks have two spaces or not.

Steps to Reproduce

  1. Write some lines, for example:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
  1. Select them all and click the monospace formatting button.
  2. A unique " ` " will be prepended/appended to the selection and it will be shown as a unique line

Proposal

Monospace formatting button should detect whether selection has multiple lines and if yes, prepend and append three grave accents, a line before and after:

```
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
```

This way the linebreaks are ketp. Nevertheless, currently, using three grave accents the text is not highlighted in purple, so that should be added too.

Technical details

https://lemmy.eus, lemmy v0.11.0

@Porrumentzio Porrumentzio added the bug Something isn't working label Jun 18, 2021
@hammsvietro
Copy link
Contributor

Hey, first time here, is this open for PRs? I'm interested in contributing

@Nutomic
Copy link
Member

Nutomic commented Jun 19, 2021

@hammsvietro Yes, go ahead. And welcome :)

@hammsvietro
Copy link
Contributor

thanks :D
About the purple highlight, the markdown highlight is usually different for three grave accents than it is for only one, should this also be changed?

@Porrumentzio
Copy link
Author

Porrumentzio commented Jun 20, 2021

I would expect purple highlighting, but if not, at least yes some highlighting

@hammsvietro
Copy link
Contributor

Ok, I'll work on it as soon as I can :)

@hammsvietro
Copy link
Contributor

@Porrumentzio @Nutomic I was looking at the code, and it looks like all the markdown styling is inherited from the selected theme. Should we proceed and override those?

@Porrumentzio
Copy link
Author

I think that each theme should be modified so it works as intended, better than overriting (as that is destructive/blocking)

@hammsvietro
Copy link
Contributor

sorry, i didn't get it, what exactly should be modified each time?

@Porrumentzio
Copy link
Author

Each theme should be modified for appropriate formatting (purpling monospace)

@hammsvietro
Copy link
Contributor

ok, I'll try that

@hammsvietro
Copy link
Contributor

@Porrumentzio Just updated all the themes to use it's default purple as the multi-line code color

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants