stencila / encoda

↔️ A format converter for Stencila documents
https://stencila.github.io/encoda/
Apache License 2.0
35 stars 9 forks source link

GDoc: encoding does not handle `QuoteBlock` #96

Open jwijay opened 5 years ago

jwijay commented 5 years ago

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)
nokome commented 5 years ago

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)

jwijay commented 5 years ago

Alright, thanks for letting me know!