From a5695edcb5ac2cc039310bde15beee62b995b198 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Thu, 9 Mar 2023 11:38:58 +0000 Subject: [PATCH] Swap out the primary Markdown bullet for one that works everywhere (#1997) * Swap out the primary Markdown bullet for one that works everywhere The primary bullet wasn't displaying well on Windows in the Windows terminal. * Refresh the snapshot tests Imagine that, changing how something looks needs that the snapshot tests get updated. *facepalm* --- CHANGELOG.md | 1 + src/textual/widgets/_markdown.py | 4 +- .../__snapshots__/test_snapshots.ambr | 262 +++++++++--------- 3 files changed, 134 insertions(+), 133 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a008e826f7..a0733b8562 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Updated styling to make it clear DataTable grows horizontally https://github.com/Textualize/textual/pull/1946 - Changed the `Checkbox` character due to issues with Windows Terminal and Windows 10 https://github.com/Textualize/textual/issues/1934 - Changed the `RadioButton` character due to issues with Windows Terminal and Windows 10 and 11 https://github.com/Textualize/textual/issues/1934 +- Changed the `Markdown` initial bullet character due to issues with Windows Terminal and Windows 10 and 11 https://github.com/Textualize/textual/issues/1982 ### Added diff --git a/src/textual/widgets/_markdown.py b/src/textual/widgets/_markdown.py index f352683f7c..8e36b3e5e0 100644 --- a/src/textual/widgets/_markdown.py +++ b/src/textual/widgets/_markdown.py @@ -393,7 +393,7 @@ class MarkdownBullet(Widget): } """ - symbol = reactive("●​") + symbol = reactive("\u25CF") """The symbol for the bullet.""" def render(self) -> Text: @@ -500,7 +500,7 @@ class Markdown(Widget): """ COMPONENT_CLASSES = {"em", "strong", "s", "code_inline"} - BULLETS = ["⏺ ", "▪ ", "‣ ", "• ", "⭑ "] + BULLETS = ["\u25CF ", "▪ ", "‣ ", "• ", "⭑ "] def __init__( self, diff --git a/tests/snapshot_tests/__snapshots__/test_snapshots.ambr b/tests/snapshot_tests/__snapshots__/test_snapshots.ambr index c6c0346c4c..312c72e6dc 100644 --- a/tests/snapshot_tests/__snapshots__/test_snapshots.ambr +++ b/tests/snapshot_tests/__snapshots__/test_snapshots.ambr @@ -14707,140 +14707,140 @@ font-weight: 700; } - .terminal-2166823333-matrix { + .terminal-4078770422-matrix { font-family: Fira Code, monospace; font-size: 20px; line-height: 24.4px; font-variant-east-asian: full-width; } - .terminal-2166823333-title { + .terminal-4078770422-title { font-size: 18px; font-weight: bold; font-family: arial; } - .terminal-2166823333-r1 { fill: #e1e1e1 } - .terminal-2166823333-r2 { fill: #121212 } - .terminal-2166823333-r3 { fill: #c5c8c6 } - .terminal-2166823333-r4 { fill: #0053aa } - .terminal-2166823333-r5 { fill: #dde8f3;font-weight: bold } - .terminal-2166823333-r6 { fill: #939393;font-weight: bold } - .terminal-2166823333-r7 { fill: #24292f } - .terminal-2166823333-r8 { fill: #e2e3e3;font-weight: bold } - .terminal-2166823333-r9 { fill: #4ebf71;font-weight: bold } - .terminal-2166823333-r10 { fill: #e1e1e1;font-style: italic; } - .terminal-2166823333-r11 { fill: #e1e1e1;font-weight: bold } + .terminal-4078770422-r1 { fill: #e1e1e1 } + .terminal-4078770422-r2 { fill: #121212 } + .terminal-4078770422-r3 { fill: #c5c8c6 } + .terminal-4078770422-r4 { fill: #0053aa } + .terminal-4078770422-r5 { fill: #dde8f3;font-weight: bold } + .terminal-4078770422-r6 { fill: #939393;font-weight: bold } + .terminal-4078770422-r7 { fill: #24292f } + .terminal-4078770422-r8 { fill: #e2e3e3;font-weight: bold } + .terminal-4078770422-r9 { fill: #4ebf71;font-weight: bold } + .terminal-4078770422-r10 { fill: #e1e1e1;font-style: italic; } + .terminal-4078770422-r11 { fill: #e1e1e1;font-weight: bold } - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - MarkdownExampleApp + MarkdownExampleApp - + - - ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - - Markdown Document - - ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ - This is an example of Textual's Markdown widget. - - ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - - Features - - ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ - Markdown syntax and extensions are supported. - - ⏺ Typography emphasisstronginline code etc. - ⏺ Headers - ⏺ Lists (bullet and ordered) - ⏺ Syntax highlighted code blocks - ⏺ Tables! - - - - + + ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + + Markdown Document + + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ + This is an example of Textual's Markdown widget. + + ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + + Features + + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ + Markdown syntax and extensions are supported. + + ● Typography emphasisstronginline code etc. + ● Headers + ● Lists (bullet and ordered) + ● Syntax highlighted code blocks + ● Tables! + + + + @@ -14871,145 +14871,145 @@ font-weight: 700; } - .terminal-3185906023-matrix { + .terminal-2722304184-matrix { font-family: Fira Code, monospace; font-size: 20px; line-height: 24.4px; font-variant-east-asian: full-width; } - .terminal-3185906023-title { + .terminal-2722304184-title { font-size: 18px; font-weight: bold; font-family: arial; } - .terminal-3185906023-r1 { fill: #c5c8c6 } - .terminal-3185906023-r2 { fill: #24292f } - .terminal-3185906023-r3 { fill: #121212 } - .terminal-3185906023-r4 { fill: #e1e1e1 } - .terminal-3185906023-r5 { fill: #e2e3e3 } - .terminal-3185906023-r6 { fill: #96989b } - .terminal-3185906023-r7 { fill: #0053aa } - .terminal-3185906023-r8 { fill: #008139 } - .terminal-3185906023-r9 { fill: #dde8f3;font-weight: bold } - .terminal-3185906023-r10 { fill: #939393;font-weight: bold } - .terminal-3185906023-r11 { fill: #e2e3e3;font-weight: bold } - .terminal-3185906023-r12 { fill: #14191f } - .terminal-3185906023-r13 { fill: #4ebf71;font-weight: bold } - .terminal-3185906023-r14 { fill: #e1e1e1;font-style: italic; } - .terminal-3185906023-r15 { fill: #e1e1e1;font-weight: bold } + .terminal-2722304184-r1 { fill: #c5c8c6 } + .terminal-2722304184-r2 { fill: #24292f } + .terminal-2722304184-r3 { fill: #121212 } + .terminal-2722304184-r4 { fill: #e1e1e1 } + .terminal-2722304184-r5 { fill: #e2e3e3 } + .terminal-2722304184-r6 { fill: #96989b } + .terminal-2722304184-r7 { fill: #0053aa } + .terminal-2722304184-r8 { fill: #008139 } + .terminal-2722304184-r9 { fill: #dde8f3;font-weight: bold } + .terminal-2722304184-r10 { fill: #939393;font-weight: bold } + .terminal-2722304184-r11 { fill: #e2e3e3;font-weight: bold } + .terminal-2722304184-r12 { fill: #14191f } + .terminal-2722304184-r13 { fill: #4ebf71;font-weight: bold } + .terminal-2722304184-r14 { fill: #e1e1e1;font-style: italic; } + .terminal-2722304184-r15 { fill: #e1e1e1;font-weight: bold } - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - MarkdownExampleApp + MarkdownExampleApp - + - - ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - ▼  Markdown Viewer - ├──  FeaturesMarkdown Viewer - ├──  Tables - └──  Code Blocks▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ - This is an example of Textual's MarkdownViewer - widget. - - ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - - Features▇▇ - - ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ - Markdown syntax and extensions are supported. - - ⏺ Typography emphasisstronginline code - etc. - ⏺ Headers - ⏺ Lists (bullet and ordered) - ⏺ Syntax highlighted code blocks - ⏺ Tables! - - ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - + + ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + ▼  Markdown Viewer + ├──  FeaturesMarkdown Viewer + ├──  Tables + └──  Code Blocks▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ + This is an example of Textual's MarkdownViewer + widget. + + ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + + Features▇▇ + + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ + Markdown syntax and extensions are supported. + + ● Typography emphasisstronginline code + etc. + ● Headers + ● Lists (bullet and ordered) + ● Syntax highlighted code blocks + ● Tables! + + ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ +