In this PR #28, I had to fix the call made to this._format_code(code) that was wrong. It previously was format_code(code);. Which does not exists. This leads me to think that maybe this feature does not work.
// A function that retro-engineer the hljs generated html to extract the code
async _extract_code_from_page(page: Page) {
let code = await page.evaluate(() => {
let code = "";
let pre = document.getElementsByTagName("pre");
for (let i = 0; i < pre.length; i++) {
let code_elem = pre[i].getElementsByTagName("code");
if (code_elem.length > 0) {
code += code_elem[0].innerText;
}
}
return code;
});
return this._format_code(code); // Used to be format_code(code);
}
In this PR #28, I had to fix the call made to
this._format_code(code)
that was wrong. It previously wasformat_code(code);
. Which does not exists. This leads me to think that maybe this feature does not work.