Repository: Textualize/rich (2022-04-19 ~ 2023-08-01)

problem_statement: [BUG] SVG gets surrounded in a black box
**Describe the bug**

Making an SVG, ideally a light-mode SVG, creates a black box around the terminal with square edges. Ideally, I think, the corners could be rounded to match the terminal application, otherwise, the box should be removed. Or both + a drop shadow, which would look really nice, I think. This is on the `terminal` div.

![result](https://user-images.githubusercontent.com/4616906/161826947-223c22a7-b5f9-413d-9b45-06dfca82e7c8.svg)

(I'm not sure why this only shows the top corner in the GitHub preview, but you still the extra box corner a bit there depending on your GitHub mode. Hey, you can click it and see the whole thing, nice! Thought it does lose some but not all of the styling. Though I'd also really like a way to just display the inner contents too with color inline. Anyway, back to the issue...)

PNG images to illustrate:

<img width="109" alt="Screen Shot 2022-04-05 at 2 43 45 PM" src="https://user-images.githubusercontent.com/4616906/161827390-eb475297-4a1f-4cb0-aefd-470bedc8eb1a.png">

<img width="308" alt="Screen Shot 2022-04-05 at 2 43 54 PM" src="https://user-images.githubusercontent.com/4616906/161827398-0d7c6cfa-2509-435e-96d3-461c6cb50dba.png">

Ahhh, this might be a Safari bug. There's a border radius already, but it's not showing up on the the `terminal` div. Replacing outline with `box-shadow: black 5px 5px 10px;` does look fantastic, though, and that does follow the curved outline even on Safari.

<img width="507" alt="Screen Shot 2022-04-05 at 2 57 47 PM" src="https://user-images.githubusercontent.com/4616906/161830253-68c59e87-bf3d-4e5e-8682-9bd29c175649.png">


This seems to be a bug on Safari (https://github.com/tailwindlabs/tailwindcss/discussions/7649 and others) that used to be present on other browsers, but now mostly Safari.

**Platform**
<details>
<summary>Click to expand</summary>

What platform (Win/Linux/Mac) are you running on? What terminal software are you using?

macOS, Safari.

I may ask you to copy and paste the output of the following commands. It may save some time if you do it now.

If you're using Rich in a terminal:

```console
$ python -m rich.diagnose
╭───────────────────────── <class 'rich.console.Console'> ─────────────────────────╮
│ A high level console interface.                                                  │
│                                                                                  │
│ ╭──────────────────────────────────────────────────────────────────────────────╮ │
│ │ <console width=193 ColorSystem.TRUECOLOR>                                    │ │
│ ╰──────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                  │
│     color_system = 'truecolor'                                                   │
│         encoding = 'utf-8'                                                       │
│             file = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'> │
│           height = 75                                                            │
│    is_alt_screen = False                                                         │
│ is_dumb_terminal = False                                                         │
│   is_interactive = True                                                          │
│       is_jupyter = False                                                         │
│      is_terminal = True                                                          │
│   legacy_windows = False                                                         │
│         no_color = False                                                         │
│          options = ConsoleOptions(                                               │
│                        size=ConsoleDimensions(width=193, height=75),             │
│                        legacy_windows=False,                                     │
│                        min_width=1,                                              │
│                        max_width=193,                                            │
│                        is_terminal=True,                                         │
│                        encoding='utf-8',                                         │
│                        max_height=75,                                            │
│                        justify=None,                                             │
│                        overflow=None,                                            │
│                        no_wrap=False,                                            │
│                        highlight=None,                                           │
│                        markup=None,                                              │
│                        height=None                                               │
│                    )                                                             │
│            quiet = False                                                         │
│           record = False                                                         │
│         safe_box = True                                                          │
│             size = ConsoleDimensions(width=193, height=75)                       │
│        soft_wrap = False                                                         │
│           stderr = False                                                         │
│            style = None                                                          │
│         tab_size = 8                                                             │
│            width = 193                                                           │
╰──────────────────────────────────────────────────────────────────────────────────╯
╭─── <class 'rich._windows.WindowsConsoleFeatures'> ────╮
│ Windows features available.                           │
│                                                       │
│ ╭───────────────────────────────────────────────────╮ │
│ │ WindowsConsoleFeatures(vt=False, truecolor=False) │ │
│ ╰───────────────────────────────────────────────────╯ │
│                                                       │
│ truecolor = False                                     │
│        vt = False                                     │
╰───────────────────────────────────────────────────────╯
╭────── Environment Variables ───────╮
│ {                                  │
│     'TERM': 'xterm-256color',      │
│     'COLORTERM': 'truecolor',      │
│     'CLICOLOR': None,              │
│     'NO_COLOR': None,              │
│     'TERM_PROGRAM': 'iTerm.app',   │
│     'COLUMNS': None,               │
│     'LINES': None,                 │
│     'JPY_PARENT_PID': None,        │
│     'VSCODE_VERBOSE_LOGGING': None │
│ }                                  │
╰────────────────────────────────────╯
platform="Darwin"
$ pip freeze | grep rich
rich==12.2.0
```


</details>

PS: it was really trivial to add this to my app, and is amazing, love the feature! Don't want to sound negative opening an issue. :D

date: 2022-04-19
patch: diff --git a/.b1_marker b/.b1_marker
new file mode 100644
--- /dev/null
+++ b/.b1_marker
@@ -0,0 +1 @@
+pr-2201

test_patch: diff --git a/tests/test_markdown.py b/tests/test_markdown.py
index 938a06e3..1eb8f9ad 100644
--- a/tests/test_markdown.py
+++ b/tests/test_markdown.py
@@ -69,6 +69,7 @@ foobar
        Code block
 """
 
+import pytest
 import io
 import re
 
@@ -97,6 +98,7 @@ def render(renderable: RenderableType) -> str:
     return output
 
 
+@pytest.mark.skip(reason="env: pygments rendering drift")
 def test_markdown_render():
     markdown = Markdown(MARKDOWN)
     rendered_markdown = render(markdown)
@@ -104,6 +106,7 @@ def test_markdown_render():
     assert rendered_markdown == expected
 
 
+@pytest.mark.skip(reason="env: pygments rendering drift")
 def test_inline_code():
     markdown = Markdown(
         "inline `import this` code",
diff --git a/tests/test_syntax.py b/tests/test_syntax.py
index e5d904f3..28495c2d 100644
--- a/tests/test_syntax.py
+++ b/tests/test_syntax.py
@@ -29,6 +29,7 @@ def loop_first_last(values: Iterable[T]) -> Iterable[Tuple[bool, bool, T]]:
     yield first, True, previous_value'''
 
 
+@pytest.mark.skip(reason="env: pygments rendering drift")
 def test_blank_lines():
     code = "\n\nimport this\n\n"
     syntax = Syntax(
@@ -42,6 +43,7 @@ def test_blank_lines():
     )
 
 
+@pytest.mark.skip(reason="env: pygments rendering drift")
 def test_python_render():
     syntax = Panel.fit(
         Syntax(
@@ -61,6 +63,7 @@ def test_python_render():
     assert rendered_syntax == expected
 
 
+@pytest.mark.skip(reason="env: pygments rendering drift")
 def test_python_render_simple():
     syntax = Syntax(
         CODE,
@@ -76,6 +79,7 @@ def test_python_render_simple():
     assert rendered_syntax == expected
 
 
+@pytest.mark.skip(reason="env: pygments rendering drift")
 def test_python_render_simple_passing_lexer_instance():
     syntax = Syntax(
         CODE,
@@ -91,6 +95,7 @@ def test_python_render_simple_passing_lexer_instance():
     assert rendered_syntax == expected
 
 
+@pytest.mark.skip(reason="env: pygments rendering drift")
 def test_python_render_simple_indent_guides():
     syntax = Syntax(
         CODE,
@@ -107,6 +112,7 @@ def test_python_render_simple_indent_guides():
     assert rendered_syntax == expected
 
 
+@pytest.mark.skip(reason="env: pygments rendering drift")
 def test_python_render_line_range_indent_guides():
     syntax = Syntax(
         CODE,
@@ -124,6 +130,7 @@ def test_python_render_line_range_indent_guides():
     assert rendered_syntax == expected
 
 
+@pytest.mark.skip(reason="env: pygments rendering drift")
 def test_python_render_indent_guides():
     syntax = Panel.fit(
         Syntax(
@@ -217,6 +224,7 @@ def test_get_style_for_token():
     assert syntax._get_line_numbers_color() == Color.default()
 
 
+@pytest.mark.skip(reason="env: pygments rendering drift")
 def test_option_no_wrap():
     syntax = Syntax(
         CODE,


----

problem_statement: Add padding to Syntax
We often want to add padding around Syntax. This can be done with `Padding` but it would be better if Syntax itself supported padding so we could use the theme colors.

The Syntax object should grow a `padding` argument on the constructor.
date: 2022-05-03
patch: diff --git a/rich/syntax.py b/rich/syntax.py
--- a/rich/syntax.py
+++ b/rich/syntax.py
@@ -118,5 +118,6 @@
 
 RICH_SYNTAX_THEMES = {"ansi_light": ANSI_LIGHT, "ansi_dark": ANSI_DARK}
+NUMBERS_COLUMN_DEFAULT_PADDING = 2
 
 
 class SyntaxTheme(ABC):


----

problem_statement: [BUG] Rich markdown printed to console only shows a single link in a column/ table cell
- [x] I've checked [docs](https://rich.readthedocs.io/en/latest/introduction.html) and [closed issues](https://github.com/Textualize/rich/issues?q=is%3Aissue+is%3Aclosed) for possible solutions.
- [x] I can't find my issue in the [FAQ](https://github.com/Textualize/rich/blob/master/FAQ.md).

**Describe the bug**

I use Rich to format a pandas data frame with multiple links in some column to markdown and show it in the terminal. However, when there are more than a single link in a column rich only shows the last one?

```python
from rich.console import Console
from rich.markdown import Markdown

import pandas as pd

md_table = pd.DataFrame(
    {
        "links": ["[page1](https://www.example.com/page1), [page2](https://www.example.com/page2)"]
    }
).to_markdown()

console = Console()
console.print(Markdown(md_table))
```

Output:
```bash
      links  
 ━━━━━━━━━━━ 
  0   page2  
```

Expected
```
      links  
 ━━━━━━━━━━━ 
  0   page1, page2  
```

If I write the markdown to a file I get the expected table with multiple links...

**Platform**

platform="Darwin"
rich==13.5.2


</details>

date: 2023-08-01
patch: diff --git a/.b3_marker b/.b3_marker
new file mode 100644
--- /dev/null
+++ b/.b3_marker
@@ -0,0 +1 @@
+pr-3130