From a9a972170926e76b55f92244ad7c08205d91429e Mon Sep 17 00:00:00 2001 From: johndmulhausen Date: Wed, 23 Oct 2013 15:46:22 -0700 Subject: [PATCH] Produces Markdown tables instead of HTML tables --- converttomarkdown.gapps | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/converttomarkdown.gapps b/converttomarkdown.gapps index b6344de..623f585 100644 --- a/converttomarkdown.gapps +++ b/converttomarkdown.gapps @@ -102,17 +102,14 @@ function processParagraph(index, element, inSrc, imageCounter, listCounters) { // Note that Markdown does not process within block-level HTML, so it probably // doesn't make sense to add markup within tables. if (element.getType() === DocumentApp.ElementType.TABLE) { - textElements.push("\n"); var nCols = element.getChild(0).getNumCells(); for (var i = 0; i < element.getNumChildren(); i++) { - textElements.push(" \n"); + textElements.push("|"); // process this row for (var j = 0; j < nCols; j++) { - textElements.push(" \n"); + textElements.push(element.getChild(i).getChild(j).getText() + "|"); } - textElements.push(" \n"); } - textElements.push("
" + element.getChild(i).getChild(j).getText() + "
\n"); } // Process various types (ElementType).