I am trying to render an HTML file using puppeteer and handlebars while storing the HTML file in the hbs template and rendering it on the go.
The issue is I am not able to fetch the data onto the script tag using the "{{variable}}" syntax, which handlebars usually generate if they are in HTML tags, but do not happen in the script tag.
One of the methods I saw was to render the value inside the input tag, and then calling the dom object to fetch the value like :
<input type = "hidden" id = "Labels" value = {{Labels}} />
and then accessing this using :
const Labels = JSON.parse(document.getElementById("Labels").value);
Is there any other method that I can do to render the HTML file using some other libraries or a way around this itself?