Skip to content

Commit

Permalink
Fix issue where markdownToHTML doesn't work properly when there are m…
Browse files Browse the repository at this point in the history
…ore than 9 items
  • Loading branch information
tom-leamon committed May 5, 2024
1 parent 578d575 commit 73b7a8a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"publishConfig": {
"registry": "https://registry.npmjs.org"
},
"version": "1.0.119",
"version": "1.0.120",
"description": "Formation is a comprehensive component library powered by React, Styled Components, and CSS variables for creating apps and websites that demand responsive, unified cross-platform experiences.",
"resolutions": {
"string-width": "^4",
Expand Down
2 changes: 1 addition & 1 deletion src/utils/markdownToHTML.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ marked.setOptions({
*/
export const markdownToHTML = (markdown: string) => {
// Normalize list items by removing extra newline characters before conversion
const normalizedMarkdown = markdown.replace(/(\r\n|\r|\n){2,}(?=\d\.|\*|\+|\-)/g, '\n')
const normalizedMarkdown = markdown.replace(/(\r\n|\r|\n){2,}(?=\d+\.|\*|\+|\-)/g, '\n')

// Convert markdown to HTML using marked library with the custom renderer
const html = marked(normalizedMarkdown)
Expand Down

0 comments on commit 73b7a8a

Please sign in to comment.