Skip to content

Commit

Permalink
fix(ui): escape list items
Browse files Browse the repository at this point in the history
Signed-off-by: stevenbjohnson <[email protected]>
  • Loading branch information
stevenbjohnson committed Nov 23, 2024
1 parent 3fffcf5 commit ebcf3e3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ui/src/workflows/components/workflows-row/workflows-row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,5 +133,11 @@ function SuspenseReactMarkdownGfm(props: {markdown: string}) {
}

function EscapeInvalidMarkdown(markdown: string) {
return markdown.replace(/\n/g, ' ').trim().replace(/`{3}/g, '').replace(/^#/g, '\\#').replace(/^>/g, '\\>');
return markdown
.replace(/([-*])\s(.*\n*)/g, '\\$1 $2')
.replace(/\n/g, ' ')
.trim()
.replace(/`{3}/g, '')
.replace(/^#/g, '\\#')
.replace(/^>/g, '\\>');
}

0 comments on commit ebcf3e3

Please sign in to comment.