Skip to content

Commit

Permalink
Update packages/@ourworldindata/components/src/MarkdownTextWrap/Markd…
Browse files Browse the repository at this point in the history
…ownTextWrap.tsx

Co-authored-by: Marcel Gerber <[email protected]>
  • Loading branch information
danyx23 and marcelgerber committed Nov 7, 2023
1 parent 099c472 commit e25aaa8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -533,11 +533,11 @@ export class MarkdownTextWrap extends React.Component<MarkdownTextWrapProps> {
// This replace is a bit funky - we want to make sure that single \n are treated as
// actual line breaks but only if none of the other markdown line break rules apply.
// These are:
// - \n\n is always a new paragrah
// - \n\n is always a new paragraph
// - Two spaces before \n is a line break (this rule is not entirely checked as we only check for a single space)
// - A backslash before \n is a line break
// The regex tries to find \n that do not belong to any of the three cases above and if none of those apply we
// replace the \n in the mached 3 characters with a backslash preceding \n to make sure it will be a line break.
// replace the \n in the matched 3 characters with a backslash preceding \n to make sure it will be a line break.
// return baseText.replaceAll(/[^\n \\]\n[^\n]/g, (match) =>
// match.replace("\n", "\\\n")
// )
Expand Down

0 comments on commit e25aaa8

Please sign in to comment.