Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions converttomarkdown.gapps
Original file line number Diff line number Diff line change
Expand Up @@ -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("<table>\n");
var nCols = element.getChild(0).getNumCells();
for (var i = 0; i < element.getNumChildren(); i++) {
textElements.push(" <tr>\n");
textElements.push("|");
// process this row
for (var j = 0; j < nCols; j++) {
textElements.push(" <td>" + element.getChild(i).getChild(j).getText() + "</td>\n");
textElements.push(element.getChild(i).getChild(j).getText() + "|");
}
textElements.push(" </tr>\n");
}
textElements.push("</table>\n");
}

// Process various types (ElementType).
Expand Down