agusmakmun / agusmakmun/django-markdown-editor

handle overflow gracefully

Ouverte
#256 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
JavaScript
Étoiles
901
Forks
1.3k
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

When I edit a md text that is wider than the editor window, then this text is not shown/cut off in the preview.
Also when I have a md text that is very long than it takes up the whole page.

Current:
![grafik](https://github.com/user-attachments/assets/3e7571e2-3ad5-4f08-a831-6508e63bc0b9)
![grafik](https://github.com/user-attachments/assets/5d783bc6-1192-43a6-8e9a-d645f6c8326b)

I propose to make the following changes to `martor.bootstrap.min.css`:

```
.main-martor {
margin: 1em 0;
position: relative;
overflow: hidden;
width: 100%
}

div.martor-preview {
padding: 1rem;
overflow: scroll;
background: #fdfdfd;
max-height: 50vh
}
```

This does the following:

- `max-height: 50vh` limit the preview height to 50vh (to avoid occupying the whole page - one can still use the full screen mode if needed
- `overflow: scroll` and `overflow: hidden` make the preview scrollable if it is too long
- `width: 100%`: let martor occupy the whole column instead of floating in the middle

Proposed solution:
![grafik](https://github.com/user-attachments/assets/cdbf4812-99ca-4409-8a83-4cf91769b0fc)
![grafik](https://github.com/user-attachments/assets/3b74ad88-7ac1-4226-8be3-8ae6b8aee6bf)

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.