From 72ed8eb8e37c1e796f5d541ae4229e7c159c06a0 Mon Sep 17 00:00:00 2001 From: jrrera Date: Sun, 25 Oct 2015 11:47:02 -0700 Subject: [PATCH] adds support for inline hyperlinks --- code.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/code.js b/code.js index b852e6a..c4eb457 100644 --- a/code.js +++ b/code.js @@ -64,9 +64,9 @@ function processItem(item, listCounters, images) { if (item.getType() == DocumentApp.ElementType.PARAGRAPH) { switch (item.getHeading()) { // Add a # for each heading level. No break, so we accumulate the right number. - case DocumentApp.ParagraphHeading.HEADING6: + case DocumentApp.ParagraphHeading.HEADING6: prefix = "
", suffix = "
"; break; - case DocumentApp.ParagraphHeading.HEADING5: + case DocumentApp.ParagraphHeading.HEADING5: prefix = "
", suffix = "
"; break; case DocumentApp.ParagraphHeading.HEADING4: prefix = "

", suffix = "

"; break; @@ -76,7 +76,7 @@ function processItem(item, listCounters, images) { prefix = "

", suffix = "

"; break; case DocumentApp.ParagraphHeading.HEADING1: prefix = "

", suffix = "

"; break; - default: + default: prefix = "

", suffix = "

"; } @@ -203,6 +203,9 @@ function processText(item, output) { else if (partText.trim().indexOf('http://') == 0) { output.push('' + partText + ''); } + else if (partAtts.LINK_URL) { + output.push('' + partText + ''); + } else { output.push(partText); }