これは、私の Google Apps スクリプト HTML テンプレートのセクションです。
<? if (filter == "ticket"){ var feedback =  sortFeedbackByDate(getRecentTicketFeedback()); }
   else if (filter == "all"){ var feedback =  sortFeedbackByDate(getAllRecentFeedback()); }
   else { var feedback = getRecentBomgarFeedback(); }
   var percHappy = getNumHappy(feedback) / feedback.length;
   var percOK = getNumOK(feedback) / feedback.length;
   var percSad = getNumSad(feedback) / feedback.length; ?>
このテンプレートで getCode() を呼び出す場合、このセクションは次のようになります。
if (filter == "ticket"){ ; 
  output._ =  '                  <option value=\"'; output._ =  ScriptApp.getService().getUrl()+"?page=1&filter=ticket" ; output._ =  '\">Ticket Feedback</option>\n';
  output._ =  '                  <option value=\"'; output._ =  ScriptApp.getService().getUrl()+"?page=1" ; output._ =  '\">Bomgar Feedback</option>\n';
  output._ =  '                  <option value=\"'; output._ =  ScriptApp.getService().getUrl()+"?page=1&filter=all" ; output._ =  '\">All Feedback</option>\n';
  output._ =  '                ';  } else if (filter == "all" { ; 
  output._ =  '                  <option value=\"'; output._ =  ScriptApp.getService().getUrl()+"?page=1&filter=ticket" ; output._ =  '\">Ticket Feedback</option>\n';
  output._ =  '                  <option value=\"'; output._ =  ScriptApp.getService().getUrl()+"?page=1&filter=all" ; output._ =  '\">All Feedback</option>\n';
  output._ =  '                  <option value=\"'; output._ =  ScriptApp.getService().getUrl()+"?page=1" ; output._ =  '\">Bomgar Feedback</option>\n';
  output._ =  '                ';  } else { ; 
  output._ =  '                  <option value=\"'; output._ =  ScriptApp.getService().getUrl()+"?page=1" ; output._ =  '\">Bomgar Feedback</option>\n';
  output._ =  '                  <option value=\"'; output._ =  ScriptApp.getService().getUrl()+"?page=1&filter=ticket" ; output._ =  '\">Ticket Feedback</option>\n';
  output._ =  '                  <option value=\"'; output._ =  ScriptApp.getService().getUrl()+"?page=1&filter=all" ; output._ =  '\">All Feedback</option>\n';
  output._ =  '                ';  } ; 
ご覧のとおり、テンプレートには次の行があります。
else if (filter == "all"){
これは、getCode() を呼び出すと次のように表示されます。
else if (filter == "all" {
これは明らかに構文エラーを引き起こします。ここで何らかのエラーが発生しましたか、それとも js コード生成のバグですか?
ありがとう