Add support for strikethrough text

This commit is contained in:
Darren Burns 2023-01-18 10:45:03 +00:00
parent d1813d2c93
commit 3f316c5ed3
3 changed files with 5 additions and 2 deletions

View File

@ -159,6 +159,7 @@ DEFAULT_STYLES: Dict[str, Style] = {
"markdown.h7": Style(italic=True, dim=True),
"markdown.link": Style(color="bright_blue"),
"markdown.link_url": Style(color="blue", underline=True),
"markdown.s": Style(strike=True),
"iso8601.date": Style(color="blue"),
"iso8601.time": Style(color="magenta"),
"iso8601.timezone": Style(color="yellow"),

View File

@ -428,7 +428,7 @@ class Markdown(JupyterMixin):
"image": ImageItem,
}
inlines = {"em", "strong", "code", "strike"}
inlines = {"em", "strong", "code", "s"}
def __init__(
self,
@ -440,7 +440,7 @@ class Markdown(JupyterMixin):
inline_code_lexer: Optional[str] = None,
inline_code_theme: Optional[str] = None,
) -> None:
parser = MarkdownIt().enable("table")
parser = MarkdownIt().enable("strikethrough")
self.markup = markup
self.parsed = parser.parse(markup)
self.code_theme = code_theme

View File

@ -1,3 +1,5 @@
# Tools
These are scripts used in the development of Rich, and aren't for general use. But feel free to look around.
Some ~~strikethrough~~ text.