mangini/gdocs2md

Unsupported child: INLINE_DRAWING

webmaster-collabforge opened this issue · 4 comments

I'm getting the following error while parsing a Google Doc.

Paragraph 438 of type PARAGRAPH has an unsupported child: INLINE_DRAWING index=438 (line 155, file "Code")

I'm getting a similar error:

Paragraph 83 of type LIST_ITEM has an unsupported child: EQUATION M index=83 (line 155, file "Code")

Instead of throwing this exception, you can replace this else block with something like

    } else {
      // throw "Paragraph "+index+" of type "+element.getType()+" has an unsupported child: "
      // +t+" "+(element.getChild(i)["getText"] ? element.getChild(i).getText():'')+" index="+index;
      textElements.push(' CONVERSION ERROR ');
    }

This will allow the conversion to go through, replacing nonconvertible elements by " CONVERSION ERROR " in the markdown document.

This is really annoying error.

After line 154 I added:

} else if (t === DocumentApp.ElementType.INLINE_DRAWING) {
      textElements.push(' (NOTE: INLINE_DRAWING NOT SUPPORTED)');