rich
rich copied to clipboard
[REQUEST] add `breaks` option to `Markdown`
in Markdown, a newline in a paragraph is a "soft break", unless it is preceded by two spaces or a backslash to make it a "hard break". soft breaks are rendered as spaces; hard breaks are rendered as line breaks.
MarkdownIt has a breaks=True option that renders softbreaks as a line break. I'd like that option on rich.markdown.Markdown too.
i'm thinking this is an easy "\n" if self.breaks else " " here:
https://github.com/Textualize/rich/blob/349042fd8912ab5f0714ff9a46a70ef8a4be4700/rich/markdown.py#L613-L616