I am using the Google Apps Script Html Service to render an HTML page.
The problem is that the HTML Entity gets displayed and not the intended special character. For example:
Miss McCleod's renders to Miss McCleod's
view source is: "text-align: center\"> Miss McCleod's
Rendering works correctly with
<code> <?=tune.tuneName?> </code>
but not with:
<h1 style="text-align:center;"><?=tune.tuneName?> </h1>
where tune.tuneName is a member variable of an object that has been pulled from the Cache. The object was populated from a google spreadsheet and Utilities.jsonStringify() and Utilities.jsonParse() were used when putting and getting to/from cache.
The HTML templates script is shown below.
<h1 style="text-align:center;"><?=tune.tuneName?> </h1>
<code> <?=tune.tuneName?> </code>
<div style="text-align:center;">
<? var imageUrl = getUrlForAttachmentFileName(tune.musicNotesImageFileName) ?>
<img src="<?=imageUrl?>" alt="<?=tune.tuneName?>" align="center">
</div>
The following code is used to instantiate the page.
tuneRec = findTuneById(tuneId);
var printHtmlTemplate = HtmlService.createTemplateFromFile('PrintPage');
printHtmlTemplate.tune = tuneRec;
return printHtmlTemplate.evaluate();
Miss McCleod&#39;s implies that double encoding is taking place.
Any ideas on how to solve for the above would be greatly appreciated.
Thanks!