-
-
Notifications
You must be signed in to change notification settings - Fork 529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Markdown pane does not render new lines as hard line breaks, configurable with hard_line_break #7582
Conversation
I'm okay with having Also, I don't think |
I think the name I also think this is actually a regression. Originally coming from Streamlit this was a major issue when moving to Panel that new lines in multiline |
Ok so I renamed it to
@ahuang11 in 728b1fa I've made a change to enable it in |
If it's a string, it should be a Markdown, but only if isinstance(message, str). |
I shortly discussed this with Philipp this morning, who told me other components can be instantiated from a string (image pointing to a URL), and that one could see ChatMessage as a sort of opinionated repr for |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7582 +/- ##
========================================
Coverage 82.24% 82.24%
========================================
Files 339 341 +2
Lines 51476 51702 +226
========================================
+ Hits 42334 42522 +188
- Misses 9142 9180 +38 ☔ View full report in Codecov by Sentry. |
Sort of addresses #7535
This PR adds a new
break_as_new
parameter (better name welcome!) to theMarkdown
pane to make it easier for users to declare whether they want simple line breaks to be rendered with a new line or not. Unfortunately, I haven't been able to find a simple way to configure MyST-Parser to toggle this behavior.Importantly, note that I am -1 on the current default in Panel which is
break_as_new=True
withmarkdown-it
. Even if I understand the motivation to make it easier to render Markdown generated by LLMs, it makes it way more difficult to display in a nice way some Markdown formatted text (pn.Column(md_intro, <objs>)
vspn.Column(pn.pane.Markdown(md_intro, break_as_new=False), <objs>)
. @ahuang11 prefers the current default, @philippjfr I'll let you chime in with your opinion (and let's wait for Andrew to be back too).Once this is settled for good, I'll add tests to this PR.