On the way to building a pack for the telegra.ph API, i hit a snag.
80% of the pack works. Now for the biggest parts: displaying content imported from telegra.ph… I would even like to be able to use the new two-way sync table.
Here’s how it works…
The step to import content from telegra.ph :
JSON (ok) >> Html (ok) > Display in a canvas (ko)
I tried to use sanitize-html to clean up the code.
But i get an error :
Error while finalizing pack version
message: 'Dynamic code evaluation not allowed'
When the display in the canva will be correct, i will work on the other way to create a page:
Canvas > Html > JSON
Anybody have a exhaustive list of the html tag use in the canvas?
Any idea to sanitize the code?
In the pack Rich Text Tools, the formula pass through the API?
Hi @j.b_o - It is correct that while Coda can display HTML as rich text, it doesn’t have support for all HTML elements and features. You can see some examples of what does and doesn’t work here:
Cleaning up the HTML before you return it to Coda is a good idea, although I’m not sure that specific library will perform. The error you are seeing is because somewhere in the library it is using an eval() expression, which we don’t allow in Packs. You could try to find an alternative library, or try to do some of the cleaning yourself.
I authored the Rich Text Tools Pack and it just uses the same HTML/Markdown parsing and rendering that is build into the Packs SDK. You can see the full source code of the Pack here:
Thank you very much for these documents which were of great help to me.
I told myself that I was going to use markdown, because the telegra.ph editor is basic… But ultimately, I have line break problems which are less present when using HTML.
I finally chose to release the pack without two-way synchronized tables. Too complicated to implement without using the canva field. It is nevertheless possible to create a custom table to have similar workflow.