File tree Expand file tree Collapse file tree 3 files changed +28
-4
lines changed
packages/richtext-lexical/src/features/blocks/server Expand file tree Collapse file tree 3 files changed +28
-4
lines changed Original file line number Diff line number Diff line change @@ -159,9 +159,6 @@ export function linesFromStartToContentAndPropsString({
159
159
}
160
160
}
161
161
162
- // Replace all \n with spaces
163
- propsString = propsString . replace ( / \n / g, ' ' ) . trim ( )
164
-
165
162
const afterEndLine = linesCopy [ endLineIndex ] . trim ( ) . slice ( endlineLastCharIndex )
166
163
167
164
return {
Original file line number Diff line number Diff line change @@ -1401,6 +1401,27 @@ Some line [Start of link
1401
1401
} ,
1402
1402
} ,
1403
1403
} ,
1404
+ {
1405
+ input : `
1406
+ <PackageInstallOptions
1407
+ update
1408
+ packageId="Line"
1409
+ someObject={{test: \`Line 1
1410
+
1411
+ Line 2\`}}
1412
+ ignored>
1413
+ </PackageInstallOptions>
1414
+ ` ,
1415
+ inputAfterConvertFromEditorJSON : `<PackageInstallOptions packageId="Line" update someObject={{"test":"Line 1\\n\\nLine 2"}}/>` ,
1416
+ blockNode : {
1417
+ fields : {
1418
+ blockType : 'PackageInstallOptions' ,
1419
+ packageId : 'Line' ,
1420
+ someObject : { test : 'Line 1\n\nLine 2' } ,
1421
+ update : true ,
1422
+ } ,
1423
+ } ,
1424
+ } ,
1404
1425
]
1405
1426
1406
1427
const INPUT_AND_OUTPUT : Tests = INPUT_AND_OUTPUTBase //.filter((test) => test.debugFlag)
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ export const PackageInstallOptions: Block = {
10
10
someNestedObject : props ?. someNestedObject ,
11
11
uniqueId : props ?. uniqueId ,
12
12
update : props ?. update ,
13
+ someObject : props ?. someObject ,
13
14
}
14
15
} ,
15
16
export : ( { fields, lexicalToMarkdown } ) => {
@@ -20,19 +21,24 @@ export const PackageInstallOptions: Block = {
20
21
someNestedObject : fields ?. someNestedObject ,
21
22
uniqueId : fields ?. uniqueId ,
22
23
update : fields ?. update ,
24
+ someObject : fields ?. someObject ,
23
25
} ,
24
26
}
25
27
} ,
26
28
} ,
27
29
fields : [
28
30
{
29
31
name : 'packageId' ,
30
- type : 'text ' ,
32
+ type : 'textarea ' ,
31
33
} ,
32
34
{
33
35
name : 'global' ,
34
36
type : 'checkbox' ,
35
37
} ,
38
+ {
39
+ name : 'someObject' ,
40
+ type : 'json' ,
41
+ } ,
36
42
{
37
43
name : 'update' ,
38
44
type : 'checkbox' ,
You can’t perform that action at this time.
0 commit comments