From 7e8fba0c8fa62876e9a5610f0d7a3f3291d29e27 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Sat, 1 Jun 2024 18:40:20 +0100 Subject: [PATCH 1/5] Remove whitespace littering --- src/textual/widgets/_markdown.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/textual/widgets/_markdown.py b/src/textual/widgets/_markdown.py index 26fda6e929..ad33b800cd 100644 --- a/src/textual/widgets/_markdown.py +++ b/src/textual/widgets/_markdown.py @@ -232,7 +232,7 @@ class MarkdownHeader(MarkdownBlock): MarkdownHeader { color: $text; margin: 2 0 1 0; - + } """ @@ -243,7 +243,7 @@ class MarkdownH1(MarkdownHeader): DEFAULT_CSS = """ MarkdownH1 { - content-align: center middle; + content-align: center middle; text-style: bold; color: $success; &:light {color: $primary;} @@ -260,7 +260,7 @@ class MarkdownH2(MarkdownHeader): text-style: underline; color: $success; &:light {color: $primary;} - + } """ @@ -270,7 +270,7 @@ class MarkdownH3(MarkdownHeader): DEFAULT_CSS = """ MarkdownH3 { - + text-style: bold; color: $success; &:light {color: $primary;} @@ -300,7 +300,7 @@ class MarkdownH5(MarkdownHeader): text-style: bold; color: $text; margin: 1 0; - + } """ @@ -493,8 +493,8 @@ class MarkdownTable(MarkdownBlock): DEFAULT_CSS = """ MarkdownTable { - width: 100%; - background: $panel; + width: 100%; + background: $panel; } """ @@ -597,11 +597,11 @@ class MarkdownFence(MarkdownBlock): margin: 1 0; overflow: auto; width: 100%; - height: auto; + height: auto; max-height: 20; color: rgb(210,210,210); - + } MarkdownFence > * { From ba5c8f62107804d6c06c22efbdd62ad119ef48b3 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Sat, 1 Jun 2024 18:43:22 +0100 Subject: [PATCH 2/5] Fix Markdown.goto_anchor not scrolling the heading into view This used to, but it seems to have broken some way along the way; perhaps because of changes to how scrolling works? The problem was observed on Discord and this would seem to fix the issue. --- src/textual/widgets/_markdown.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/textual/widgets/_markdown.py b/src/textual/widgets/_markdown.py index ad33b800cd..e5da42b23b 100644 --- a/src/textual/widgets/_markdown.py +++ b/src/textual/widgets/_markdown.py @@ -839,7 +839,7 @@ def goto_anchor(self, anchor: str) -> bool: unique = TrackedSlugs() for _, title, header_id in self._table_of_contents: if unique.slug(title) == anchor: - self.parent.scroll_to_widget(self.query_one(f"#{header_id}"), top=True) + self.query_one(f"#{header_id}").scroll_visible(top=True) return True return False From 6115b9ebc66b2f53733d81119641f3087a7307e0 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Sat, 1 Jun 2024 18:46:47 +0100 Subject: [PATCH 3/5] Remove whitespace littering --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90e4cfb1a0..a7872a4616 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -99,7 +99,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Dependency issue -## [0.60.0] - 2024-05-14 +## [0.60.0] - 2024-05-14 ### Fixed @@ -206,7 +206,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Added - Added `Size.with_width` and `Size.with_height` https://github.com/Textualize/textual/pull/4393 - + ### Fixed - Fixed issue with inline mode and multiple screens https://github.com/Textualize/textual/pull/4393 @@ -221,7 +221,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Fixed -- Fixed mouse escape sequences being generated with `mouse=False` +- Fixed mouse escape sequences being generated with `mouse=False` ## [0.55.0] - 2024-04-1 From c63c08a69b242ce7f7244d09952a1d2a592c0ab5 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Sat, 1 Jun 2024 18:46:55 +0100 Subject: [PATCH 4/5] Update the ChangeLog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7872a4616..fa97fe0f1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## Unreleased + +### Fixed + +- Fixed `Markdown.goto_anchor` no longer scrolling the heading into view. + ## [0.63.6] - 2024-05-29 ### Fixed From f27a92197d74ed6ab494401c11fdfe306db64c52 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Sat, 1 Jun 2024 18:55:59 +0100 Subject: [PATCH 5/5] Add a link to the PR to the ChangeLog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa97fe0f1a..dc7242d4ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Fixed -- Fixed `Markdown.goto_anchor` no longer scrolling the heading into view. +- Fixed `Markdown.goto_anchor` no longer scrolling the heading into view https://github.com/Textualize/textual/pull/4583 ## [0.63.6] - 2024-05-29