Skip to content

Commit

Permalink
Change markdown rendering to set breaks to false (#5368)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
abidlabs and gradio-pr-bot committed Aug 29, 2023
1 parent b896889 commit b27f758
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
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

0 comments on commit b27f758

Please sign in to comment.