@@ -860,8 +860,12 @@ const f = {
860860 var collection = content . ele ( key ) . att ( 'jcr:primaryType' , 'nt:unstructured' )
861861 for ( var i = 0 ; i < value . length ; i ++ ) {
862862 var children = collection . ele ( key + i ) . att ( 'jcr:primaryType' , 'nt:unstructured' )
863- for ( childKey in value [ i ] )
864- children . att ( childKey , value [ i ] [ childKey ] )
863+ for ( childKey in value [ i ] ) {
864+ if ( value [ i ] [ childKey ] . startsWith ( '{' ) )
865+ children . att ( childkey , '\\' + value [ i ] [ childKey ] )
866+ else
867+ children . att ( childKey , value [ i ] [ childKey ] )
868+ }
865869 }
866870 } else {
867871 content . att ( key , value )
@@ -891,11 +895,18 @@ const f = {
891895 var collection = versionContent . ele ( key ) . att ( 'jcr:primaryType' , 'nt:unstructured' )
892896 for ( var i = 0 ; i < value . length ; i ++ ) {
893897 var children = collection . ele ( key + i ) . att ( 'jcr:primaryType' , 'nt:unstructured' )
894- for ( childKey in value [ i ] )
895- children . att ( childKey , value [ i ] [ childKey ] )
898+ for ( childKey in value [ i ] ) {
899+ if ( value [ i ] [ childKey ] . startsWith ( '{' ) )
900+ children . att ( childkey , '\\' + value [ i ] [ childKey ] )
901+ else
902+ children . att ( childKey , value [ i ] [ childKey ] )
903+ }
896904 }
897905 } else {
898- versionContent . att ( key , value )
906+ if ( value . toString ( ) . startsWith ( '{' ) )
907+ versionContent . att ( key , '\\' + value )
908+ else
909+ versionContent . att ( key , value )
899910 }
900911 }
901912 return xml
0 commit comments