File tree 2 files changed +11
-2
lines changed
2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ const leftPageContents = [
20
20
title : "Parameters" ,
21
21
paragraphs : [
22
22
"Define some parameters:" ,
23
- "• Choose a court to arbitrate the case.<br/> • Select a category.<br/> • Select the number of jurors." ,
23
+ "• Choose a court to arbitrate the case.\n • Select a category.\n • Select the number of jurors." ,
24
24
"The more jurors you select, higher the arbitration cost will be. By default we use 3 jurors for the first " +
25
25
"round. The arbitration cost is the value used to pay the jurors for their work." ,
26
26
] ,
Original file line number Diff line number Diff line change @@ -52,6 +52,15 @@ const StyledParagraph = styled.p`
52
52
53
53
const extractGuideName = ( linkText ) => linkText . split ( ". " ) [ 1 ] ;
54
54
55
+ const processNewLineInParagraph = ( paragraph : string ) => {
56
+ return paragraph . split ( "\n" ) . map ( ( text , index ) => (
57
+ < React . Fragment key = { index } >
58
+ { index > 0 && < br /> }
59
+ { text }
60
+ </ React . Fragment >
61
+ ) ) ;
62
+ } ;
63
+
55
64
const LeftContent : React . FC < {
56
65
currentPage : number ;
57
66
leftPageContents : {
@@ -68,7 +77,7 @@ const LeftContent: React.FC<{
68
77
< Title > { title } </ Title >
69
78
< ParagraphsContainer >
70
79
{ paragraphs . map ( ( paragraph , index ) => (
71
- < StyledParagraph key = { index } dangerouslySetInnerHTML = { { __html : paragraph } } / >
80
+ < StyledParagraph key = { index } > { processNewLineInParagraph ( paragraph ) } </ StyledParagraph >
72
81
) ) }
73
82
</ ParagraphsContainer >
74
83
{ links && links . length > 0 && toggleSubMiniGuide ? (
You can’t perform that action at this time.
0 commit comments