encoda
encoda copied to clipboard
GDoc: encoding does not handle `CodeFragment`
When backticks are present in a md
file, e.g.:
`test`
The following error occurs during conversion from md
to gdoc
:
⇒ npx ts-node --files src/cli convert examples/R-ecology-lesson/README2.md ./examples/output/README2-from-md.gdoc
(node:32829) UnhandledPromiseRejectionWarning: Error: Unhandled node type function type(node) {
if (node === null)
return 'null';
let type = typeof node;
if (type === 'object') {
if (Array.isArray(node))
return 'array';
if (node.type)
return node.type;
}
return type;
}
at encodeInlineContent (/Users/Jacqueline/Desktop/Stencila/encoda/src/gdoc.ts:576:13)
at Array.map (<anonymous>)
at encodeParagraph (/Users/Jacqueline/Desktop/Stencila/encoda/src/gdoc.ts:308:30)
at encodeNode (/Users/Jacqueline/Desktop/Stencila/encoda/src/gdoc.ts:226:28)
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)
Not fixed but updated the error in 7cdfcfb to show the node type correctly:
(node:1776) UnhandledPromiseRejectionWarning: Error: Unhandled node type Code
at encodeInlineContent (~/encoda/src/gdoc.ts:575:13)
Need to implement rRPNGs here.
Labelling as low priority because encoding to GDoc is a low priority right now.