From 36ff8f687ef03f63eb680d379e8aefa707d42e1b Mon Sep 17 00:00:00 2001 From: Pope Kim Date: Tue, 3 Jul 2018 21:04:28 -0700 Subject: [PATCH] fixed font checking logic to use string the old logic is deprecated as written here. https://developers.google.com/apps-script/reference/document/font-family --- converttomarkdown.gapps | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/converttomarkdown.gapps b/converttomarkdown.gapps index b6344de..b2f466d 100644 --- a/converttomarkdown.gapps +++ b/converttomarkdown.gapps @@ -251,6 +251,8 @@ function processTextElement(inSrc, txt) { var attrs=txt.getTextAttributeIndices(); var lastOff=pOut.length; + const COURIER_NEW = "Courier New"; + for (var i=attrs.length-1; i>=0; i--) { var off=attrs[i]; var url=txt.getLinkUrl(off); @@ -264,8 +266,8 @@ function processTextElement(inSrc, txt) { } pOut=pOut.substring(0, off)+'['+pOut.substring(off, lastOff)+']('+url+')'+pOut.substring(lastOff); } else if (font) { - if (!inSrc && font===font.COURIER_NEW) { - while (i>=1 && txt.getFontFamily(attrs[i-1]) && txt.getFontFamily(attrs[i-1])===font.COURIER_NEW) { + if (!inSrc && font===COURIER_NEW) { + while (i>=1 && txt.getFontFamily(attrs[i-1]) && txt.getFontFamily(attrs[i-1])===COURIER_NEW) { // detect fonts that are in multiple pieces because of errors on formatting: i-=1; off=attrs[i];