Skip to content
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

Change markdown rendering to set breaks to false #5368

Merged
merged 6 commits into from Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/shy-fans-chew.md
@@ -0,0 +1,6 @@
---
"@gradio/markdown": patch
"gradio": patch
---

fix:Change markdown rendering to set breaks to false
24 changes: 20 additions & 4 deletions js/markdown/Markdown.stories.svelte
Expand Up @@ -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="Simple inline Markdown" />

<Story name="Right aligned Markdown with HTML" args={{ rtl: true }} />
<Story
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 math"
name="Markdown with LaTeX"
args={{
value: "What is the solution of $y=x^2$?",
latex_delimiters: [{ left: "$", right: "$", display: false }]
Expand Down
2 changes: 1 addition & 1 deletion js/markdown/static/utils.ts
Expand Up @@ -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
Expand Down