Solved

Lucid Import Document API - HTML Line Breaks and bullets being ignored.

  • 19 February 2024
  • 7 replies
  • 58 views

Badge +1

I’ve been experimenting with the Import document API using the standard lucid format, and it’s been great for the most part. One thing I’m running into though, is it seems like when I supply line breaks or bulleted lists via HTML, the breaks/bullets get ignored. I’ve tried even uploading the sample I found in Github, https://github.com/lucidsoftware/sample-lucid-rest-applications/blob/44f7c102b8dec5fd2495aaba17c6797aff668ca8/standard-import/demo-files/filesystem/unzipped-contents/document.json#L11 and I don’t think the line break for that is working either. Has anyone had success with this? Curious if it’s end user error on my end. I’m hoping to get to where we can have code produce our diagrams, and being able to create line breaks/bullets programmatically will be key for our diagrams.

Here is some example JSON I’ve tried to upload.

{

    "version":1,

    "pages":[

      {

        "id":"page1",

        "title":"New Page",

        "shapes":[

          {"id":"block0","type":"stickyNote","customData":[{"key":"Num","value":"0"},{"key":"Prev","value":"=upstream.Num"}],"boundingBox":{"x":100,"y":100,"w":100,"h":100},"text":"Placeholder,Line should break <br> Block {{=@Num}}"},

          {"id":"block1","type":"stickyNote","customData":[{"key":"Num","value":"1"},{"key":"Prev","value":"=upstream.Num"}],"boundingBox":{"x":300,"y":100,"w":100,"h":100},"text":"Pre Line Break<br> post line break Block {{=@Num}}"},

          {"id":"block2","type":"stickyNote","customData":[{"key":"Num","value":"2"},{"key":"Prev","value":"=upstream.Num"}],"boundingBox":{"x":500,"y":100,"w":100,"h":100},"text":"Block {{=@Num}}"},

          {"id":"block3","type":"stickyNote","customData":[{"key":"Num","value":"3"},{"key":"Prev","value":"=upstream.Num"}],"boundingBox":{"x":700,"y":100,"w":100,"h":100},"text":"Block {{=@Num}}"},

          {"id":"block4","type":"stickyNote","customData":[{"key":"Num","value":"4"},{"key":"Prev","value":"=upstream.Num"}],"boundingBox":{"x":900,"y":100,"w":100,"h":100},"text":"Block {{=@Num}}"},

          {"id":"block5","type":"stickyNote","customData":[{"key":"Num","value":"5"},{"key":"Prev","value":"=upstream.Num"}],"boundingBox":{"x":100,"y":300,"w":100,"h":100},"text":"Block {{=@Num}}"},

          {"id":"block6","type":"stickyNote","customData":[{"key":"Num","value":"6"},{"key":"Prev","value":"=upstream.Num"}],"boundingBox":{"x":300,"y":300,"w":100,"h":100},"text":"Block {{=@Num}}"},

          {"id":"block7","type":"stickyNote","customData":[{"key":"Num","value":"7"},{"key":"Prev","value":"=upstream.Num"}],"boundingBox":{"x":500,"y":300,"w":100,"h":100},"text":"Block {{=@Num}}"},

          {"id":"block8","type":"stickyNote","customData":[{"key":"Num","value":"8"},{"key":"Prev","value":"=upstream.Num"}],"boundingBox":{"x":700,"y":300,"w":100,"h":100},"text":"Block {{=@Num}}"},

          {"id":"block9","type":"stickyNote","customData":[{"key":"Num","value":"9"},{"key":"Prev","value":"=upstream.Num"}],"boundingBox":{"x":900,"y":300,"w":100,"h":100},"text":"Block {{=@Num}}"}

        ],

        "lines":[

          {"id":"line0","lineType":"elbow","text":[{"text":"{{=upstream.Num}} to {{=downstream.Num}}","position":0.5,"side":"middle"}],"endpoint1":{"type":"shapeEndpoint","style":"none","shapeId":"block0","position":{"x":1,"y":0.5}},"endpoint2":{"type":"shapeEndpoint","style":"arrow","shapeId":"block1","position":{"x":0,"y":0.5}}},

          {"id":"line1","lineType":"elbow","text":[{"text":"{{=upstream.Num}} to {{=downstream.Num}}","position":0.5,"side":"middle"}],"endpoint1":{"type":"shapeEndpoint","style":"none","shapeId":"block1","position":{"x":1,"y":0.5}},"endpoint2":{"type":"shapeEndpoint","style":"arrow","shapeId":"block2","position":{"x":0,"y":0.5}}},

          {"id":"line2","lineType":"elbow","text":[{"text":"{{=upstream.Num}} to {{=downstream.Num}}","position":0.5,"side":"middle"}],"endpoint1":{"type":"shapeEndpoint","style":"none","shapeId":"block2","position":{"x":1,"y":0.5}},"endpoint2":{"type":"shapeEndpoint","style":"arrow","shapeId":"block3","position":{"x":0,"y":0.5}}},

          {"id":"line3","lineType":"elbow","text":[{"text":"{{=upstream.Num}} to {{=downstream.Num}}","position":0.5,"side":"middle"}],"endpoint1":{"type":"shapeEndpoint","style":"none","shapeId":"block3","position":{"x":1,"y":0.5}},"endpoint2":{"type":"shapeEndpoint","style":"arrow","shapeId":"block4","position":{"x":0,"y":0.5}}},

          {"id":"line4","lineType":"elbow","text":[{"text":"{{=upstream.Num}} to {{=downstream.Num}}","position":0.5,"side":"middle"}],"endpoint1":{"type":"shapeEndpoint","style":"none","shapeId":"block4","position":{"x":1,"y":0.5}},"endpoint2":{"type":"shapeEndpoint","style":"arrow","shapeId":"block5","position":{"x":0,"y":0.5}}},

          {"id":"line5","lineType":"elbow","text":[{"text":"{{=upstream.Num}} to {{=downstream.Num}}","position":0.5,"side":"middle"}],"endpoint1":{"type":"shapeEndpoint","style":"none","shapeId":"block5","position":{"x":1,"y":0.5}},"endpoint2":{"type":"shapeEndpoint","style":"arrow","shapeId":"block6","position":{"x":0,"y":0.5}}},

          {"id":"line6","lineType":"elbow","text":[{"text":"{{=upstream.Num}} to {{=downstream.Num}}","position":0.5,"side":"middle"}],"endpoint1":{"type":"shapeEndpoint","style":"none","shapeId":"block6","position":{"x":1,"y":0.5}},"endpoint2":{"type":"shapeEndpoint","style":"arrow","shapeId":"block7","position":{"x":0,"y":0.5}}},

          {"id":"line7","lineType":"elbow","text":[{"text":"{{=upstream.Num}} to {{=downstream.Num}}","position":0.5,"side":"middle"}],"endpoint1":{"type":"shapeEndpoint","style":"none","shapeId":"block7","position":{"x":1,"y":0.5}},"endpoint2":{"type":"shapeEndpoint","style":"arrow","shapeId":"block8","position":{"x":0,"y":0.5}}},

          {"id":"line8","lineType":"elbow","text":[{"text":"{{=upstream.Num}} to {{=downstream.Num}}","position":0.5,"side":"middle"}],"endpoint1":{"type":"shapeEndpoint","style":"none","shapeId":"block8","position":{"x":1,"y":0.5}},"endpoint2":{"type":"shapeEndpoint","style":"arrow","shapeId":"block9","position":{"x":0,"y":0.5}}}

        ]

      }

    ]

  }

icon

Best answer by chasefreeman 22 February 2024, 19:10

View original

Comments

Userlevel 3
Badge +3

Hi DaltonC!

 

First, glad to hear you’re having a generally positive experience with the API! We worked hard on it and we’re proud of it 😀. And thanks for reaching out; we’re always looking to fix/improve the stuff that isn’t working or is confusing. 

Today the Lucid USA office is on vacation for Presidents Day, and the team most familiar with the API is US-based. However, I’ll ask them to respond early tomorrow.

 

Thanks!

Ian

Userlevel 2
Badge

Hello! I’m one of the developers working with Ian.

I tested out the JSON you included, our GitHub sample code, and some other imports with bulleted lists, and I found the same behavior that you described of line breaks and bullets being ignored. So I think it’s safe to say the problem isn’t user error. Currently digging into why this might be happening and how to fix it. Thank you for your patience in working with us!

Badge +1

No problem, appreciate you taking a look.

 

Userlevel 1
Badge

Hey DaltonC!


Just to give you a quick update. We have identified the underlying issue, are working on a fix, and expect that fix to be coming relatively soon.

Thanks for reporting it and your patience while we investigated!

Badge +1

Awesome, appreciate the update. Mind posting here once you’ve pushed the fix? 
 

Userlevel 1
Badge

No problem and not at all! I’ll update this thread as soon as the fix is out. 

Userlevel 1
Badge

The fix has been pushed and should be available now.

 

Please let us know if you run into any other issues!

Reply