Skip to content

Commit

Permalink
feat(frontend): add support for GFM and fix max-width issue
Browse files Browse the repository at this point in the history
  • Loading branch information
fatonramadani committed Jul 10, 2024
1 parent acc68a9 commit cc2ed04
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
10 changes: 5 additions & 5 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
"quill": "^1.3.7",
"svelte-carousel": "^1.0.25",
"svelte-chartjs": "^3.1.5",
"svelte-exmarkdown": "^3.0.3",
"svelte-exmarkdown": "^3.0.5",
"svelte-infinite-loading": "^1.3.8",
"svelte-portal": "^2.2.1",
"svelte-tiny-virtual-list": "^2.0.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import { components } from '../../editor/component'
import ResolveConfig from '../helpers/ResolveConfig.svelte'
import ResolveStyle from '../helpers/ResolveStyle.svelte'
import { gfmPlugin } from 'svelte-exmarkdown/gfm'
export let id: string
export let componentInput: AppInput | undefined
export let initializing: boolean | undefined = undefined
Expand Down Expand Up @@ -67,7 +67,7 @@
e?.preventDefault()
}}
class={classNames(
'h-full w-full overflow-y-auto prose',
'h-full w-full overflow-y-auto prose max-w-full',
resolvedConfig?.size ? proseMapping[resolvedConfig.size] : '',
css?.container?.class,
' dark:prose-invert',
Expand All @@ -86,7 +86,10 @@
>
{#if result}
{#key result}
<Markdown md={result} />
<Markdown
md={result}
plugins={resolvedConfig?.GithubFlavoredMarkdownEnabled ? [gfmPlugin()] : []}
/>
{/key}
{/if}
</RunnableWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1600,6 +1600,12 @@ This is a paragraph.
value: 'Default',

tooltip: 'See Tailwind documentation: https://tailwindcss.com/docs/typography-plugin'
},
GithubFlavoredMarkdownEnabled: {
fieldType: 'boolean',
type: 'static',
value: false,
tooltip: 'Enable Github flavored markdown. Lean more at https://github.github.com/gfm/'
}
}
}
Expand Down

0 comments on commit cc2ed04

Please sign in to comment.