diff --git a/flameshow/models.py b/flameshow/models.py index faa346e..4d04088 100644 --- a/flameshow/models.py +++ b/flameshow/models.py @@ -88,7 +88,7 @@ def render_detail(self, sample_index: int, sample_unit: str): Text.assemble( (" ", Style(bgcolor=frame.display_color.rich_color)), " ", - Text.from_markup(line), + line, ) ) frame = frame.parent diff --git a/flameshow/parsers/stackcollapse_parser.py b/flameshow/parsers/stackcollapse_parser.py index ceacb67..e3de44f 100644 --- a/flameshow/parsers/stackcollapse_parser.py +++ b/flameshow/parsers/stackcollapse_parser.py @@ -3,6 +3,8 @@ import re from typing import Dict +from rich.text import Text + from flameshow.models import Frame, Profile, SampleType logger = logging.getLogger(__name__) @@ -12,7 +14,7 @@ class StackCollapseFrame(Frame): def render_one_frame_detail( self, frame, sample_index: int, sample_unit: str ): - return [f"{frame.name}\n"] + return [Text(f"{frame.name}\n")] class StackCollapseParser: diff --git a/flameshow/pprof_parser/parser.py b/flameshow/pprof_parser/parser.py index 7e3dec2..ea24aae 100644 --- a/flameshow/pprof_parser/parser.py +++ b/flameshow/pprof_parser/parser.py @@ -11,6 +11,8 @@ import logging from typing import Dict, List +from rich.text import Text + from flameshow.models import Frame, Profile, SampleType from . import profile_pb2 @@ -112,7 +114,7 @@ def render_one_frame_detail(self, frame, sample_index, sample_unit): f" [grey37]{frame.line.function.filename}, [b]line" f" {frame.line.line_no}[/b][/grey37]\n" ) - return [line1, line2] + return [Text.from_markup(line1), Text.from_markup(line2)] @property def title(self) -> str: