Skip to content

The removed Markdown.code_* attrs continue to be used in markdown examples and tests #6451

@Jackenmen

Description

@Jackenmen

Welp, this is a bit akward because this was originally supposed to just be a PR with the following changeset:
Jackenmen@dd6d07c
However, since you're travelling right now, PRs are currently restricted. So, issue it is because otherwise I will just forget about this entirely 😄


#5967 removed code_indent_guides from Markdown and MarkdownViewer, but that PR missed removing its use in code examples.

This PR The changeset linked above just removes the lines that were setting that attribute in the examples.

I want to note that, while searching for those attributes, I've also noticed that there seems to still be one snapshot app in tests that sets the Markdown's theme attributes:
https://github.com/Textualize/textual/blob/e84eacc1899f940ea068c4ae5c7eca2dd4a489db/tests/snapshot_tests/snapshot_apps/markdown_theme_switcher.py
Perhaps this is done on purpose to avoid regression but technically, the switch dark/light actions could be completely removed from that code and the snapshots will remain the same:

diff --git a/tests/snapshot_tests/snapshot_apps/markdown_theme_switcher.py b/tests/snapshot_tests/snapshot_apps/markdown_theme_switcher.py
index c71c26b8c..21f615641 100644
--- a/tests/snapshot_tests/snapshot_apps/markdown_theme_switcher.py
+++ b/tests/snapshot_tests/snapshot_apps/markdown_theme_switcher.py
@@ -13,18 +13,8 @@ def main():
 class MarkdownThemeSwitcherApp(App[None]):
     BINDINGS = [
         ("t", "toggle_theme"),
-        ("d", "switch_dark"),
-        ("l", "switch_light"),
     ]
 
-    def action_switch_dark(self) -> None:
-        md = self.query_one(Markdown)
-        md.code_dark_theme = "solarized-dark"
-
-    def action_switch_light(self) -> None:
-        md = self.query_one(Markdown)
-        md.code_light_theme = "solarized-light"
-
     def action_toggle_theme(self) -> None:
         self.theme = "textual-light" if self.theme == "textual-dark" else "textual-dark"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions