From 219e468f758ee97cf4fd1e51e9a4821361a348de Mon Sep 17 00:00:00 2001 From: OlivierChirouze Date: Thu, 16 Mar 2017 12:05:00 +0100 Subject: [PATCH] Support courier new Hi! I am by no means familiar with Google Apps scripts, but I can see the detection of Courier New fonts doesn't work for me unless I put the explicit name "Courier New". Also, this page seems to say that the enum is deprecated anyway: https://developers.google.com/apps-script/reference/document/font-family This proposed fix did the job for me but please comment if a better alternative exists! Thanks for the great job anyway. --- converttomarkdown.gapps | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/converttomarkdown.gapps b/converttomarkdown.gapps index b6344de..a48acb8 100644 --- a/converttomarkdown.gapps +++ b/converttomarkdown.gapps @@ -264,8 +264,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];