failed NO_PATCH NO_PATCH UNSUBMITTED empty_patch(timeout) · 19 tool calls · 0 s · Textualize/rich
Update to markdown styles Updates to Markdown styling
| # | Tool | Arguments | Result |
|---|---|---|---|
| 1 | run_command | {
"command": "cd /workspace && git log --oneline -5 && ls rich/"
} | {"status": "error", "error_type": "CommandError", "error_message": "Command failed with exit code 1", "details": {"stdout": "", "stderr": "/bin/bash: line 0: cdfull{"status": "error", "error_type": "CommandError", "error_message": "Command failed with exit code 1", "details": {"stdout": "", "stderr": "/bin/bash: line 0: cd: /tmp/swe_work/or20_qwen27b_v2/rich_3942/a/workspace: No such file or directory\n", "exit_code": 1}} |
| 2 | run_command | {
"command": "cd /workspace && head -50 CHANGELOG.md"
} | {"status": "error", "error_type": "CommandError", "error_message": "Command failed with exit code 1", "details": {"stdout": "", "stderr": "/bin/bash: line 0: cdfull{"status": "error", "error_type": "CommandError", "error_message": "Command failed with exit code 1", "details": {"stdout": "", "stderr": "/bin/bash: line 0: cd: /tmp/swe_work/or20_qwen27b_v2/rich_3942/a/workspace: No such file or directory\n", "exit_code": 1}} |
| 3 | run_command | {
"command": "pwd && ls"
} | {"status": "ok", "stdout": "/private/workspace\nassets\nasv.conf.json\nasvhashfile\nbenchmarks\nCHANGELOG.md\nCODE_OF_CONDUCT.md\nCONTRIBUTING.md\nCONTRIBUTORS.full{"status": "ok", "stdout": "/private/workspace\nassets\nasv.conf.json\nasvhashfile\nbenchmarks\nCHANGELOG.md\nCODE_OF_CONDUCT.md\nCONTRIBUTING.md\nCONTRIBUTORS.md\ndocs\nexamples\nFAQ.md\nfaq.yml\nimgs\nLICENSE\nmake.bat\nMakefile\npoetry.lock\npyproject.toml\npytest.ini\nquestions\nREADME.cn.md\nREADME.de-ch.md\nREADME.de.md\nREADME.es.md\nREADME.fa.md\nREADME.fr.md\nREADME.hi.md\nREADME.id.md\nREADME.it.md\nREADME.ja.md\nREADME.kr.md\nREADME.md\nREADME.pl.md\nREADME.pt-br.md\nREADME.ru.md\nREADME.sv.md\nREADME.tr.md\nREADME.zh-tw.md\nrich\nSECURITY.md\nsetup.py\ntests\ntools\ntox.ini\n", "exit_code": 0} |
| 4 | run_command | {
"command": "git log --oneline -5 && git status"
} | {"status": "ok", "stdout": "be309beb baseline\ne5b0f2c1 contributing\n8a825dfd remove error docstring\n86427612 faqs\nff8cb6f3 faq\nOn branch main\nnothing to cfull{"status": "ok", "stdout": "be309beb baseline\ne5b0f2c1 contributing\n8a825dfd remove error docstring\n86427612 faqs\nff8cb6f3 faq\nOn branch main\nnothing to commit, working tree clean\n", "exit_code": 0} |
| 5 | run_command | {
"command": "head -40 CHANGELOG.md"
} | {"status": "ok", "stdout": "# Changelog\n\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Changelog](httfull{"status": "ok", "stdout": "# Changelog\n\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),\nand this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n\n## [Unreleased]\n\n### Fixed\n\n- IPython now respects when a `Console` instance is passed to `pretty.install` https://github.com/Textualize/rich/pull/3915\n- Fixed extraneous blank line on non-interactive disabled `Progress` https://github.com/Textualize/rich/pull/3905\n- Fixed extra padding on first cell in columns https://github.com/Textualize/rich/pull/3935\n- Fixed trailing whitespace removed when soft_wrap=True https://github.com/Textualize/rich/pull/3937\n- Fixed style new-lines when soft_wrap = True and a print style is set https://github.com/Textualize/rich/pull/3938\n\n### Added\n\n- Added support for some multi-codepopint glyphs (will fix alignment issues for these characters) https://github.com/Textualize/rich/pull/3930\n- Added support for `UNICODE_VERSION` environment variable https://github.com/Textualize/rich/pull/3930\n- Added `last_render_height` property to LiveRender https://github.com/Textualize/rich/pull/3934\n- Expose locals_max_depth and locals_overflow in traceback.install https://github.com/Textualize/rich/pull/3906/\n- Added `Segment.split_lines_terminator` https://github.com/Textualize/rich/pull/3938\n\n### Changed\n\n- `cells.cell_len` now has a `unicode_version` parameter (that you probably should never change) https://github.com/Textualize/rich/pull/3930\n- Live will not write a new line if there was nothing rendered https://github.com/Textualize/rich/pull/3934\n\n## [14.2.0] - 2025-10-09\n\n### Changed\n\n- Python3.14 compatibility https://github.com/Textualize/rich/pull/3861\n\n### Fixed\n\n- Fixed exception when calling `inspect` on objects with unusual `__qualname__` attribute https://github.com/Textualize/rich/pull/3894\n\n", "exit_code": 0} |
| 6 | run_command | {
"command": "grep -n \"style\" rich/markdown.py | head -60"
} | {"status": "ok", "stdout": "20:from .style import Style, StyleStack\n94: style_name = \"none\"\n97: self.style = context.enter_style(self.style_name)\n101: selffull{"status": "ok", "stdout": "20:from .style import Style, StyleStack\n94: style_name = \"none\"\n97: self.style = context.enter_style(self.style_name)\n101: self.text.append(text, context.current_style if isinstance(text, str) else None)\n104: context.leave_style()\n110: style_name = \"markdown.paragraph\"\n136: context.enter_style(self.style_name)\n140: self.style_name = f\"markdown.{tag}\"\n153: style=\"markdown.h1.border\",\n165: style_name = \"markdown.code_block\"\n190: style_name = \"markdown.block_quote\"\n203: lines = console.render_lines(self.elements, render_options, style=self.style)\n204: style = self.style\n206: padding = Segment(\"\u258c \", style)\n221: style = console.get_style(\"markdown.hr\", default=\"none\")\n222: yield Rule(style=style)\n300: style = str(token.attrs.get(\"style\")) or \"\"\n303: if \"text-align:right\" in style:\n305: elif \"text-align:center\" in style:\n307: elif \"text-align:left\" in style:\n321: text.stylize(context.current_style)\n360: style_name = \"markdown.item\"\n371: lines = console.render_lines(self.elements, render_options, style=self.style)\n372: bullet_style = console.get_style(\"markdown.item.bullet\", default=\"none\")\n374: bullet = Segment(\" \u2022 \", bullet_style)\n375: padding = Segment(\" \" * 3, bullet_style)\n387: lines = console.render_lines(self.elements, render_options, style=self.style)\n388: number_style = console.get_style(\"markdown.item.number\", default=\"none\")\n391: padding = Segment(\" \" * number_width, number_style)\n392: numeral = Segment(f\"{number}\".rjust(number_width - 1) + \" \", number_style)\n435: self.link = context.current_style.link\n442: link_style = Style(link=self.link or self.destination or None)\n445: title.stylize(link_style)\n457: style: Style,\n463: |
| 7 | run_command | {
"command": "grep -rn \"markdown\" tests/test_markdown.py | head -5; wc -l rich/markdown.py"
} | {"status": "ok", "stdout": "tests/test_markdown.py:76:from rich.markdown import Markdown\ntests/test_markdown.py:99:def test_markdown_render():\ntests/test_markfull{"status": "ok", "stdout": "tests/test_markdown.py:76:from rich.markdown import Markdown\ntests/test_markdown.py:99:def test_markdown_render():\ntests/test_markdown.py:100: markdown = Markdown(MARKDOWN)\ntests/test_markdown.py:101: rendered_markdown = render(markdown)\ntests/test_markdown.py:103: assert rendered_markdown == expected\n 779 rich/markdown.py\n", "exit_code": 0} |
| 8 | run_command | {
"command": "grep -n \"markdown\" rich/console.py | head -40"
} | {"status": "ok", "stdout": "", "exit_code": 0}full{"status": "ok", "stdout": "", "exit_code": 0} |
| 9 | run_command | {
"command": "grep -rn \"markdown\" tests/test_markdown.py | wc -l; grep -n \"def test\" tests/test_markdown.py"
} | {"status": "ok", "stdout": " 18\n99:def test_markdown_render():\n106:def test_inline_code():\n119:def test_markdown_table():\n136:def test_inline_styles_in_tablfull{"status": "ok", "stdout": " 18\n99:def test_markdown_render():\n106:def test_inline_code():\n119:def test_markdown_table():\n136:def test_inline_styles_in_table():\n151:def test_inline_styles_with_justification():\n169:def test_partial_table():\n177:def test_table_with_empty_cells() -> None:\n", "exit_code": 0} |
| 10 | run_command | {
"command": "grep -rn \"markdown\" rich/ --include=*.py | grep -v \"rich/markdown.py\" | head -30"
} | {"status": "ok", "stdout": "rich/tree.py:206: from rich.markdown import Markdown\nrich/tree.py:230: markdown = Markdown(\nrich/tree.py:244: simple_node.add(Groufull{"status": "ok", "stdout": "rich/tree.py:206: from rich.markdown import Markdown\nrich/tree.py:230: markdown = Markdown(\nrich/tree.py:244: simple_node.add(Group(\"\ud83d\udcc4 Markdown\", Panel(markdown, border_style=\"green\")))\nrich/default_styles.py:142: \"markdown.paragraph\": Style(),\nrich/default_styles.py:143: \"markdown.text\": Style(),\nrich/default_styles.py:144: \"markdown.em\": Style(italic=True),\nrich/default_styles.py:145: \"markdown.emph\": Style(italic=True), # For commonmark backwards compatibility\nrich/default_styles.py:146: \"markdown.strong\": Style(bold=True),\nrich/default_styles.py:147: \"markdown.code\": Style(bold=True, color=\"cyan\", bgcolor=\"black\"),\nrich/default_styles.py:148: \"markdown.code_block\": Style(color=\"cyan\", bgcolor=\"black\"),\nrich/default_styles.py:149: \"markdown.block_quote\": Style(color=\"magenta\"),\nrich/default_styles.py:150: \"markdown.list\": Style(color=\"cyan\"),\nrich/default_styles.py:151: \"markdown.item\": Style(),\nrich/default_styles.py:152: \"markdown.item.bullet\": Style(color=\"yellow\", bold=True),\nrich/default_styles.py:153: \"markdown.item.number\": Style(color=\"yellow\", bold=True),\nrich/default_styles.py:154: \"markdown.hr\": Style(color=\"yellow\"),\nrich/default_styles.py:155: \"markdown.h1.border\": Style(),\nrich/default_styles.py:156: \"markdown.h1\": Style(bold=True),\nrich/default_styles.py:157: \"markdown.h2\": Style(bold=True, underline=True),\nrich/default_styles.py:158: \"markdown.h3\": Style(bold=True),\nrich/default_styles.py:159: \"markdown.h4\": Style(bold=True, dim=True),\nrich/default_styles.py:160: \"markdown.h5\": Style(underline=True),\nrich/default_styles.py:161: \"markdown.h6\": Style(italic=True),\nrich/default_styles.py:162: \"markdown.h7\": Style(italic=True, dim=True),\nrich/default_styles.py:163: \"markdown.link\": Style(color=\"bright_blue\"),\nrich/default_styles.py:164: \"markd |
| 11 | read_file | {
"filepath": "tests/test_markdown.py",
"start_line": 1,
"end_line": 120
} | {"status": "ok", "filepath": "tests/test_markdown.py", "content": "# coding=utf-8\n\nMARKDOWN = \"\"\"Heading\n=======\n\nSub-heading\n-----------\n\n### Headinfull{"status": "ok", "filepath": "tests/test_markdown.py", "content": "# coding=utf-8\n\nMARKDOWN = \"\"\"Heading\n=======\n\nSub-heading\n-----------\n\n### Heading\n\n#### H4 Heading\n\n##### H5 Heading\n\n###### H6 Heading\n\n\nParagraphs are separated\nby a blank line.\n\nTwo spaces at the end of a line\nproduces a line break.\n\nText attributes _italic_,\n**bold**, `monospace`.\n\nHorizontal rule:\n\n---\n\nBullet list:\n\n * apples\n * oranges\n * pears\n\nNumbered list:\n\n 1. lather\n 2. rinse\n 3. repeat\n\nAn [example](http://example.com).\n\n> Markdown uses email-style > characters for blockquoting.\n>\n> Lorem ipsum\n\n\n\n\n```\na=1\n```\n\n```python\nimport this\n```\n\n```somelang\nfoobar\n```\n\n import this\n\n\n1. List item\n\n Code block\n\"\"\"\n\nimport io\nimport re\n\nfrom rich.console import Console, RenderableType\nfrom rich.markdown import Markdown\n\nre_link_ids = re.compile(r\"id=[\\d\\.\\-]*?;.*?\\x1b\")\n\n\ndef replace_link_ids(render: str) -> str:\n \"\"\"Link IDs have a random ID and system path which is a problem for\n reproducible tests.\n\n \"\"\"\n return re_link_ids.sub(\"id=0;foo\\x1b\", render)\n\n\ndef render(renderable: RenderableType) -> str:\n console = Console(\n width=100, file=io.StringIO(), color_system=\"truecolor\", legacy_windows=False\n )\n console.print(renderable)\n output = replace_link_ids(console.file.getvalue())\n print(repr(output))\n return output\n\n\ndef test_markdown_render():\n markdown = Markdown(MARKDOWN)\n rendered_markdown = render(markdown)\n expected = \"\u250f\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501 |
| 12 | read_file | {
"filepath": "rich/markdown.py",
"start_line": 1,
"end_line": 230
} | {"status": "ok", "filepath": "rich/markdown.py", "content": "from __future__ import annotations\n\nimport sys\nfrom typing import ClassVar, Iterable, get_args\nfull{"status": "ok", "filepath": "rich/markdown.py", "content": "from __future__ import annotations\n\nimport sys\nfrom typing import ClassVar, Iterable, get_args\n\nfrom markdown_it import MarkdownIt\nfrom markdown_it.token import Token\n\nfrom rich.table import Table\n\nfrom . import box\nfrom ._loop import loop_first\nfrom ._stack import Stack\nfrom .console import Console, ConsoleOptions, JustifyMethod, RenderResult\nfrom .containers import Renderables\nfrom .jupyter import JupyterMixin\nfrom .panel import Panel\nfrom .rule import Rule\nfrom .segment import Segment\nfrom .style import Style, StyleStack\nfrom .syntax import Syntax\nfrom .text import Text, TextType\n\n\nclass MarkdownElement:\n new_line: ClassVar[bool] = True\n\n @classmethod\n def create(cls, markdown: Markdown, token: Token) -> MarkdownElement:\n \"\"\"Factory to create markdown element,\n\n Args:\n markdown (Markdown): The parent Markdown object.\n token (Token): A node from markdown-it.\n\n Returns:\n MarkdownElement: A new markdown element\n \"\"\"\n return cls()\n\n def on_enter(self, context: MarkdownContext) -> None:\n \"\"\"Called when the node is entered.\n\n Args:\n context (MarkdownContext): The markdown context.\n \"\"\"\n\n def on_text(self, context: MarkdownContext, text: TextType) -> None:\n \"\"\"Called when text is parsed.\n\n Args:\n context (MarkdownContext): The markdown context.\n \"\"\"\n\n def on_leave(self, context: MarkdownContext) -> None:\n \"\"\"Called when the parser leaves the element.\n\n Args:\n context (MarkdownContext): [description]\n \"\"\"\n\n def on_child_close(self, context: MarkdownContext, child: MarkdownElement) -> bool:\n \"\"\"Called when a child element is closed.\n\n This method allows a parent element to take over rendering of its children.\n\n Args:\n |
| 13 | read_file | {
"filepath": "rich/markdown.py",
"start_line": 150,
"end_line": 230
} | {"status": "ok", "filepath": "rich/markdown.py", "content": " yield Panel(\n text,\n box=box.HEAVY,\n style=\"markdown.h1.border\",\n )\n else:\n # Styled text full{"status": "ok", "filepath": "rich/markdown.py", "content": " yield Panel(\n text,\n box=box.HEAVY,\n style=\"markdown.h1.border\",\n )\n else:\n # Styled text for h2 and beyond\n if self.tag == \"h2\":\n yield Text(\"\")\n yield text\n\n\nclass CodeBlock(TextElement):\n \"\"\"A code block with syntax highlighting.\"\"\"\n\n style_name = \"markdown.code_block\"\n\n @classmethod\n def create(cls, markdown: Markdown, token: Token) -> CodeBlock:\n node_info = token.info or \"\"\n lexer_name = node_info.partition(\" \")[0]\n return cls(lexer_name or \"text\", markdown.code_theme)\n\n def __init__(self, lexer_name: str, theme: str) -> None:\n self.lexer_name = lexer_name\n self.theme = theme\n\n def __rich_console__(\n self, console: Console, options: ConsoleOptions\n ) -> RenderResult:\n code = str(self.text).rstrip()\n syntax = Syntax(\n code, self.lexer_name, theme=self.theme, word_wrap=True, padding=1\n )\n yield syntax\n\n\nclass BlockQuote(TextElement):\n \"\"\"A block quote.\"\"\"\n\n style_name = \"markdown.block_quote\"\n\n def __init__(self) -> None:\n self.elements: Renderables = Renderables()\n\n def on_child_close(self, context: MarkdownContext, child: MarkdownElement) -> bool:\n self.elements.append(child)\n return False\n\n def __rich_console__(\n self, console: Console, options: ConsoleOptions\n ) -> RenderResult:\n render_options = options.update(width=options.max_width - 4)\n lines = console.render_lines(self.elements, render_options, style=self.style)\n style = self.style\n new_line = Segment(\"\\n\")\n padding = Segment(\"\u258c \", style)\n for line in lines:\n yield padding\n yield from line\n yield new_line\n\ |
| 14 | read_file | {
"filepath": "rich/markdown.py",
"start_line": 420,
"end_line": 470
} | {"status": "ok", "filepath": "rich/markdown.py", "content": " markdown (Markdown): The parent Markdown object.\n token (Any): A token from markdown-it.\n\n Retufull{"status": "ok", "filepath": "rich/markdown.py", "content": " markdown (Markdown): The parent Markdown object.\n token (Any): A token from markdown-it.\n\n Returns:\n MarkdownElement: A new markdown element\n \"\"\"\n return cls(str(token.attrs.get(\"src\", \"\")), markdown.hyperlinks)\n\n def __init__(self, destination: str, hyperlinks: bool) -> None:\n self.destination = destination\n self.hyperlinks = hyperlinks\n self.link: str | None = None\n super().__init__()\n\n def on_enter(self, context: MarkdownContext) -> None:\n self.link = context.current_style.link\n self.text = Text(justify=\"left\")\n super().on_enter(context)\n\n def __rich_console__(\n self, console: Console, options: ConsoleOptions\n ) -> RenderResult:\n link_style = Style(link=self.link or self.destination or None)\n title = self.text or Text(self.destination.strip(\"/\").rsplit(\"/\", 1)[-1])\n if self.hyperlinks:\n title.stylize(link_style)\n text = Text.assemble(\"\ud83c\udf06 \", title, \" \", end=\"\")\n yield text\n\n\nclass MarkdownContext:\n \"\"\"Manages the console render state.\"\"\"\n\n def __init__(\n self,\n console: Console,\n options: ConsoleOptions,\n style: Style,\n inline_code_lexer: str | None = None,\n inline_code_theme: str = \"monokai\",\n ) -> None:\n self.console = console\n self.options = options\n self.style_stack: StyleStack = StyleStack(style)\n self.stack: Stack[MarkdownElement] = Stack()\n\n self._syntax: Syntax | None = None\n if inline_code_lexer is not None:\n self._syntax = Syntax(\"\", inline_code_lexer, theme=inline_code_theme)\n\n @property\n", "start_line": 420, "end_line": 470, "total_lines": 779, "is_truncated": false} |
| 15 | run_command | {
"command": "ls questions/ 2>/dev/null; cat questions/* 2>/dev/null | head -50"
} | {"status": "ok", "stdout": "ansi_escapes.question.md\nemoji_broken.question.md\nhighlight_incorrect.question.md\nhighlighting_unexpected.question.md\njupyter.qufull{"status": "ok", "stdout": "ansi_escapes.question.md\nemoji_broken.question.md\nhighlight_incorrect.question.md\nhighlighting_unexpected.question.md\njupyter.question.md\nlog_renderables.question.md\nlogging_color.question.md\nREADME.md\nrich_spinner.question.md\nsquare_brackets.question.md\ntracebacks_installed.question.md\n---\ntitle: \"Natively inserted ANSI escape sequence characters break alignment of Panel.\"\nalt_titles:\n - \"Escape codes break alignment.\"\n---\n\nIf you print ansi escape sequences for color and style you may find the output breaks your output.\nYou may find that border characters in Panel and Table are in the wrong place, for example.\n\nAs a general rule, you should allow Rich to generate all ansi escape sequences, so it can correctly account for these invisible characters.\nIf you can't avoid a string with escape codes, you can convert it to an equivalent `Text` instance with `Text.from_ansi`.\n---\ntitle: \"Why does emoji break alignment in a Table or Panel?\"\n---\n\nCertain emoji take up double space within the terminal. Unfortunately, terminals don't always agree how wide a given character should be.\n\nRich has no way of knowing how wide a character will be on any given terminal. This can break alignment in containers like Table and Panel, where Rich needs to know the width of the content.\n\nThere are also *multiple codepoints* characters, such as country flags, and emoji modifiers, which produce wildly different results across terminal emulators. \n\nFortunately, most characters will work just fine. But you may have to avoid using the emojis that break alignment. You will get good results if you stick to emoji released on or before version 9 of the Unicode database, \n---\ntitle: \"Incorrect highlights in printed output\"\nalt_title:\n - \"Highlighter not highlighting data\"\n---\n\nRich's default highlighter will highlight a number of common patterns, useful for debugging.\nOccasionally you may find that it highlights text in |
| 16 | run_command | {
"command": "python3 -c \"import rich; print(rich.__file__)\"; pip show rich 2>/dev/null | head -5"
} | {"status": "ok", "stdout": "/private/workspace/rich/__init__.py\n", "exit_code": 0}full{"status": "ok", "stdout": "/private/workspace/rich/__init__.py\n", "exit_code": 0} |
| 17 | run_command | {
"command": "grep -n \"markdown\\.\" docs/source/markdown.rst | head -40"
} | {"status": "ok", "stdout": "4:Rich can render Markdown to the console. To render markdown, construct a :class:`~rich.markdown.Markdown` object then print it to full{"status": "ok", "stdout": "4:Rich can render Markdown to the console. To render markdown, construct a :class:`~rich.markdown.Markdown` object then print it to the console. Markdown is a great way of adding rich content to your command line applications. Here's an example of use::\n9: Rich can do a pretty *decent* job of rendering markdown.\n", "exit_code": 0} |
| 18 | run_command | {
"command": "sed -n '130,170p' rich/default_styles.py"
} | {"status": "ok", "stdout": " \"progress.description\": Style.null(),\n \"progress.filesize\": Style(color=\"green\"),\n \"progress.filesize.total\": Style(colorfull{"status": "ok", "stdout": " \"progress.description\": Style.null(),\n \"progress.filesize\": Style(color=\"green\"),\n \"progress.filesize.total\": Style(color=\"green\"),\n \"progress.download\": Style(color=\"green\"),\n \"progress.elapsed\": Style(color=\"yellow\"),\n \"progress.percentage\": Style(color=\"magenta\"),\n \"progress.remaining\": Style(color=\"cyan\"),\n \"progress.data.speed\": Style(color=\"red\"),\n \"progress.spinner\": Style(color=\"green\"),\n \"status.spinner\": Style(color=\"green\"),\n \"tree\": Style(),\n \"tree.line\": Style(),\n \"markdown.paragraph\": Style(),\n \"markdown.text\": Style(),\n \"markdown.em\": Style(italic=True),\n \"markdown.emph\": Style(italic=True), # For commonmark backwards compatibility\n \"markdown.strong\": Style(bold=True),\n \"markdown.code\": Style(bold=True, color=\"cyan\", bgcolor=\"black\"),\n \"markdown.code_block\": Style(color=\"cyan\", bgcolor=\"black\"),\n \"markdown.block_quote\": Style(color=\"magenta\"),\n \"markdown.list\": Style(color=\"cyan\"),\n \"markdown.item\": Style(),\n \"markdown.item.bullet\": Style(color=\"yellow\", bold=True),\n \"markdown.item.number\": Style(color=\"yellow\", bold=True),\n \"markdown.hr\": Style(color=\"yellow\"),\n \"markdown.h1.border\": Style(),\n \"markdown.h1\": Style(bold=True),\n \"markdown.h2\": Style(bold=True, underline=True),\n \"markdown.h3\": Style(bold=True),\n \"markdown.h4\": Style(bold=True, dim=True),\n \"markdown.h5\": Style(underline=True),\n \"markdown.h6\": Style(italic=True),\n \"markdown.h7\": Style(italic=True, dim=True),\n \"markdown.link\": Style(color=\"bright_blue\"),\n \"markdown.link_url\": Style(color=\"blue\", underline=True),\n \"markdown.s\": Style(strike=True),\n \"iso8601.date\": Style(color=\"blue\"),\n \"iso8601.time\": Style(color=\"magenta\"),\n \"iso8601.timezone\": Style(color=\"yellow\"),\n}\n\n", "exit_code |
| 19 | read_file | {
"filepath": "rich/markdown.py",
"start_line": 490,
"end_line": 640
} | {"status": "ok", "filepath": "rich/markdown.py", "content": " return self.current_style\n\n def leave_style(self) -> Style:\n \"\"\"Leave a style context.\"\"\"full{"status": "ok", "filepath": "rich/markdown.py", "content": " return self.current_style\n\n def leave_style(self) -> Style:\n \"\"\"Leave a style context.\"\"\"\n style = self.style_stack.pop()\n return style\n\n\nclass Markdown(JupyterMixin):\n \"\"\"A Markdown renderable.\n\n Args:\n markup (str): A string containing markdown.\n code_theme (str, optional): Pygments theme for code blocks. Defaults to \"monokai\". See https://pygments.org/styles/ for code themes.\n justify (JustifyMethod, optional): Justify value for paragraphs. Defaults to None.\n style (Union[str, Style], optional): Optional style to apply to markdown.\n hyperlinks (bool, optional): Enable hyperlinks. Defaults to ``True``.\n inline_code_lexer: (str, optional): Lexer to use if inline code highlighting is\n enabled. Defaults to None.\n inline_code_theme: (Optional[str], optional): Pygments theme for inline code\n highlighting, or None for no highlighting. Defaults to None.\n \"\"\"\n\n elements: ClassVar[dict[str, type[MarkdownElement]]] = {\n \"paragraph_open\": Paragraph,\n \"heading_open\": Heading,\n \"fence\": CodeBlock,\n \"code_block\": CodeBlock,\n \"blockquote_open\": BlockQuote,\n \"hr\": HorizontalRule,\n \"bullet_list_open\": ListElement,\n \"ordered_list_open\": ListElement,\n \"list_item_open\": ListItem,\n \"image\": ImageItem,\n \"table_open\": TableElement,\n \"tbody_open\": TableBodyElement,\n \"thead_open\": TableHeaderElement,\n \"tr_open\": TableRowElement,\n \"td_open\": TableDataElement,\n \"th_open\": TableDataElement,\n }\n\n inlines = {\"em\", \"strong\", \"code\", \"s\"}\n\n def __init__(\n self,\n markup: str,\n code_theme: str = \"monokai\",\n justify: JustifyMethod | None = None,\n style: str | Style = \" |