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({
159159 }
160160 }
161161
162- // Replace all \n with spaces
163- propsString = propsString . replace ( / \n / g, ' ' ) . trim ( )
164-
165162 const afterEndLine = linesCopy [ endLineIndex ] . trim ( ) . slice ( endlineLastCharIndex )
166163
167164 return {
Original file line number Diff line number Diff line change @@ -1401,6 +1401,27 @@ Some line [Start of link
14011401 } ,
14021402 } ,
14031403 } ,
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+ } ,
14041425 ]
14051426
14061427 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 = {
1010 someNestedObject : props ?. someNestedObject ,
1111 uniqueId : props ?. uniqueId ,
1212 update : props ?. update ,
13+ someObject : props ?. someObject ,
1314 }
1415 } ,
1516 export : ( { fields, lexicalToMarkdown } ) => {
@@ -20,19 +21,24 @@ export const PackageInstallOptions: Block = {
2021 someNestedObject : fields ?. someNestedObject ,
2122 uniqueId : fields ?. uniqueId ,
2223 update : fields ?. update ,
24+ someObject : fields ?. someObject ,
2325 } ,
2426 }
2527 } ,
2628 } ,
2729 fields : [
2830 {
2931 name : 'packageId' ,
30- type : 'text ' ,
32+ type : 'textarea ' ,
3133 } ,
3234 {
3335 name : 'global' ,
3436 type : 'checkbox' ,
3537 } ,
38+ {
39+ name : 'someObject' ,
40+ type : 'json' ,
41+ } ,
3642 {
3743 name : 'update' ,
3844 type : 'checkbox' ,
You can’t perform that action at this time.
0 commit comments