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 widget, list before header, line across multiple lines #1807

Closed
Paul-Aime opened this issue Feb 16, 2023 · 2 comments · Fixed by #1832
Closed

Markdown widget, list before header, line across multiple lines #1807

Paul-Aime opened this issue Feb 16, 2023 · 2 comments · Fixed by #1832
Labels
bug Something isn't working Task

Comments

@Paul-Aime
Copy link

Paul-Aime commented Feb 16, 2023

Thanks for the amazing markdown support.

I noticed 2 small bugs when trying it:

  • A line split across multiple lines will not be displayed with spaces in between words ending/starting line (it does in rich --markdown)
  • Some padding is missing in between a list and an header level 3 following line.

Screenshot:

(Also the screenshot automatically generated gives bad borders and headers' underlines but it looks good in my terminal).

markdownapp_2023-02-16T09_20_29_145944

Code for the app:

#! /home/paul/.local/opt/pipx/venvs/textual/bin/python

import sys
from textual.app import App, ComposeResult
from textual.widgets import Markdown


class MarkdownApp(App):
    fpath = sys.argv[1]

    def compose(self) -> ComposeResult:
        with open(self.fpath) as f:
            text = f.read()
        yield Markdown(markdown=text)


if __name__ == "__main__":
    app = MarkdownApp()
    app.run()

The input file used:

# Header 1

## Header 2

- A list before
- an header 3
- is NOT OK

### Header 3 (1)

Line written
on multiple
lines.

A line before an header 3 is OK

### Header 3 (2)

```python
print("Code block before Header 3 is OK")
```

### Header 3 (3)

THE END.

textual diagnose:

# Textual Diagnostics

## Versions

| Name    | Value  |
|---------|--------|
| Textual | 0.11.0 |
| Rich    | 13.3.1 |

## Python

| Name           | Value                                               |
|----------------|-----------------------------------------------------|
| Version        | 3.8.10                                              |
| Implementation | CPython                                             |
| Compiler       | GCC 9.4.0                                           |
| Executable     | /home/paul/.local/opt/pipx/venvs/textual/bin/python |

## Operating System

| Name    | Value                                       |
|---------|---------------------------------------------|
| System  | Linux                                       |
| Release | 5.14.0-1057-oem                             |
| Version | #64-Ubuntu SMP Mon Jan 23 17:02:19 UTC 2023 |

## Terminal

| Name                 | Value       |
|----------------------|-------------|
| Terminal Application | Kitty       |
| TERM                 | xterm-kitty |
| COLORTERM            | truecolor   |
| FORCE_COLOR          | *Not set*   |
| NO_COLOR             | *Not set*   |

## Rich Console options

| Name           | Value                |
|----------------|----------------------|
| size           | width=106, height=21 |
| legacy_windows | False                |
| min_width      | 1                    |
| max_width      | 106                  |
| is_terminal    | True                 |
| encoding       | utf-8                |
| max_height     | 21                   |
| justify        | None                 |
| overflow       | None                 |
| no_wrap        | False                |
| highlight      | None                 |
| markup         | None                 |
| height         | None                 |
@Textualize Textualize deleted a comment from github-actions bot Feb 16, 2023
@davep davep added bug Something isn't working Task labels Feb 16, 2023
@Paul-Aime
Copy link
Author

Actually, for the lack of padding after a list, it is not just when an H3 is following, it is the same when a plain line is following.

@github-actions
Copy link

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

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

Successfully merging a pull request may close this issue.

2 participants