agusmakmun / agusmakmun/django-markdown-editor

handle overflow gracefully

Đang mở
#256 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
901
Fork
1.3k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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)

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.