diff --git a/dsmview/__init__.py b/dsmview/__init__.py index 3ced358..b5fdc75 100644 --- a/dsmview/__init__.py +++ b/dsmview/__init__.py @@ -1 +1 @@ -__version__ = "0.2.1" +__version__ = "0.2.2" diff --git a/dsmview/ui/tabs/logs.py b/dsmview/ui/tabs/logs.py index 42820c0..c189a1b 100644 --- a/dsmview/ui/tabs/logs.py +++ b/dsmview/ui/tabs/logs.py @@ -3,6 +3,7 @@ from __future__ import annotations from collections import deque from typing import Deque +from rich.markup import escape from textual.app import ComposeResult from textual.containers import Container from textual.widgets import RichLog, Static @@ -66,8 +67,11 @@ class LogsTab(Container): Severity.OTHER: theme.BORDER_TITLE, } color = color_for[line.severity] + # Raw log lines often contain literal brackets like + # `[/path/to/file]` which Rich's markup parser tries to interpret + # as closing tags. Escape so they render as text. src = f"[dim]{line.source:<8}[/]" - return f"{src} [{color}]{line.raw}[/]" + return f"{src} [{color}]{escape(line.raw)}[/]" def _rerender(self) -> None: self.log_view.clear() diff --git a/pyproject.toml b/pyproject.toml index d45f10e..26591ce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "dsmview" -version = "0.2.1" +version = "0.2.2" description = "TUI SSH monitor for Synology DSM 7.x" readme = "README.md" license = { text = "MIT" }