Change markdown rendering to set breaks to false (#5368)

* change markdown rendering to set breaks to false

* add changeset

* update stories

* lint

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
This commit is contained in:
Abubakar Abid 2023-08-29 11:20:41 -07:00 committed by GitHub
parent b89688984f
commit b27f758325
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 6 deletions

View File

@ -0,0 +1,6 @@
---
"@gradio/markdown": patch
"gradio": patch
---
fix:Change markdown rendering to set breaks to false

View File

@ -18,17 +18,33 @@
<Template let:args>
<Markdown
value="Here's some <strong>bold</strong> text. And some <em>italics</em> and some <code>code</code>"
value="Here's some **bold** text. And some *italics* and some `code`"
latex_delimiters={[]}
{...args}
/>
</Template>
<Story name="Simple inline Markdown with HTML" />
<Story name="Right aligned Markdown with HTML" args={{ rtl: true }} />
<Story name="Simple inline Markdown" />
<Story
name="Markdown with math"
name="Multiline Markdown"
args={{
value: `
This should
all be in one line.
---
This should be
in two separate lines.`
}}
/>
<Story name="Right aligned Markdown" args={{ rtl: true }} />
<Story
name="Markdown with LaTeX"
args={{
value: "What is the solution of $y=x^2$?",
latex_delimiters: [{ left: "$", right: "$", display: false }]

View File

@ -107,7 +107,7 @@ const renderer: Partial<Omit<Renderer, "constructor" | "options">> = {
marked.use(
{
gfm: true,
breaks: true,
breaks: false,
pedantic: false,
headerIds: false,
mangle: false