Skip to content

Commit

Permalink
Treat a code_block markdown token the same as a fence
Browse files Browse the repository at this point in the history
I believe this should be a fine way to solve this. I don't see anything that
means that a `code_block` is in any way different than a fenced block that
has no syntax specified.

See Textualize#2781.
  • Loading branch information
davep committed Jun 19, 2023
1 parent 90696ca commit 89e25ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/textual/widgets/_markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ def update(self, markdown: str) -> None:
style_stack.pop()

stack[-1].set_content(content)
elif token.type == "fence":
elif token.type in ("fence", "code_block"):
output.append(
MarkdownFence(
self,
Expand Down

0 comments on commit 89e25ce

Please sign in to comment.