Path 1: 91 calls (0.99)

' ' (5) ', ' (4) 'Heading' (4) '.' (4) 'bold' (3) 'italic' (3) 'Sub-heading' (2) 'H4 Heading' (2) 'H5 Heading' (2) 'H6 Heading' (2)

'text' (79) 'softbreak' (4) 'code' (3) 'link' (3) 'linebreak' (2)

1def on_text(self, text: str, node_type: str) -> None:
2        """Called when the parser visits text."""
3        if node_type in "code" and self._syntax is not None:
4            highlight_text = self._syntax.highlight(text)
5            highlight_text.rstrip()
6            self.stack.top.on_text(
7                self, Text.assemble(highlight_text, style=self.style_stack.current)
8            )
9        else:
10            self.stack.top.on_text(self, text)
            

Path 2: 1 calls (0.01)

'import this' (1)

'code' (1)

1def on_text(self, text: str, node_type: str) -> None:
2        """Called when the parser visits text."""
3        if node_type in "code" and self._syntax is not None:
4            highlight_text = self._syntax.highlight(text)
5            highlight_text.rstrip()
6            self.stack.top.on_text(
7                self, Text.assemble(highlight_text, style=self.style_stack.current)
8            )
9        else:
10            self.stack.top.on_text(self, text)