@truto/truto-jsonata 1.0.14 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.js CHANGED
@@ -633,19 +633,28 @@ const $d584c575eabd606d$var$parseMarkedTokenToNotionRequest = (tokens, acc = [])
633
633
  if (!text) return acc;
634
634
  const textToInsert = (0, $e8d3ca61f6a67481$export$2e2bcd8739ae039)(text);
635
635
  // chunk the text into 2000 character chunks, should handle emojis and multi-byte characters
636
- const chunks = $d584c575eabd606d$var$chunkText(textToInsert);
637
- (0, $hgUW1$each)(chunks, (chunk)=>{
638
- acc.push({
639
- type: "text",
640
- text: {
641
- content: chunk
642
- },
643
- ...token.type === "codespan" ? {
644
- annotations: {
645
- code: true
646
- }
647
- } : {}
648
- });
636
+ const textSplitByNewLine = textToInsert.split("\n");
637
+ const chunksOfChunks = (0, $hgUW1$compact)((0, $hgUW1$map)(textSplitByNewLine, (chunk)=>$d584c575eabd606d$var$chunkText(chunk)));
638
+ const chunksWithNewLines = (0, $hgUW1$flattenDeep)((0, $8f5fb75395ee9099$export$2e2bcd8739ae039)((0, $hgUW1$map)(chunksOfChunks, (chunk)=>{
639
+ return (0, $hgUW1$map)(chunk, (_chunk)=>({
640
+ type: "text",
641
+ text: {
642
+ content: _chunk
643
+ },
644
+ ...token.type === "codespan" ? {
645
+ annotations: {
646
+ code: true
647
+ }
648
+ } : {}
649
+ }));
650
+ }), {
651
+ type: "text",
652
+ text: {
653
+ content: "\n"
654
+ }
655
+ }));
656
+ (0, $hgUW1$each)(chunksWithNewLines, (chunk)=>{
657
+ acc.push(chunk);
649
658
  });
650
659
  return acc;
651
660
  }, acc);