encoda icon indicating copy to clipboard operation
encoda copied to clipboard

GDoc: encoding does not handle `CodeFragment`

Open jwijay opened this issue 5 years ago • 2 comments

When backticks are present in a md file, e.g.:

`test`

The following error occurs during conversion from md to gdoc: Screenshot 2019-06-05 17 26 43

⇒  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)

jwijay avatar Jun 06 '19 00:06 jwijay

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.

beneboy avatar Jun 07 '19 03:06 beneboy

Labelling as low priority because encoding to GDoc is a low priority right now.

nokome avatar Jun 14 '19 03:06 nokome