encoda icon indicating copy to clipboard operation
encoda copied to clipboard

GDoc: encoding does not handle `QuoteBlock`

Open jwijay opened this issue 5 years ago • 2 comments

Tested conversion to gdoc with the following md file: https://github.com/datacarpentry/R-ecology-lesson/blob/master/README.md

⇒  npx ts-node --files src/cli convert examples/R-ecology-lesson/README.md ./examples/output/README-from-md.gdoc
(node:31238) UnhandledPromiseRejectionWarning: Error: Unhandled Stencila node type "QuoteBlock"
    at encodeNode (/Users/Jacqueline/Desktop/Stencila/encoda/src/gdoc.ts:241:17)
    at Object.encode (/Users/Jacqueline/Desktop/Stencila/encoda/src/gdoc.ts:60:16)
    at encode (/Users/Jacqueline/Desktop/Stencila/encoda/src/index.ts:231:16)

jwijay avatar Jun 05 '19 23:06 jwijay

Just wanted to explain that I originally put these "Unhandled node type" exceptions in the code (for gdoc, pandoc and other codecs) as much as anything to create a TODO item when we came examples like this one.

https://github.com/stencila/encoda/blob/69dc39f8768856747288169beacc115707185aa7/src/gdoc.ts#L241-L242

The other approach is to not throw an error and instead have a fallback that is lossy.

Either way, the conversion to gdoc is not a high priority right now because to actually create a new GDoc we have to go via HTML (due to limitations in the GDoc API)

nokome avatar Jun 06 '19 00:06 nokome

Alright, thanks for letting me know!

jwijay avatar Jun 06 '19 00:06 jwijay