Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does the exctract_code_from_page feature works? #31

Open
bidoubiwa opened this issue Jun 21, 2023 · 1 comment
Open

Does the exctract_code_from_page feature works? #31

bidoubiwa opened this issue Jun 21, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@bidoubiwa
Copy link
Contributor

bidoubiwa commented Jun 21, 2023

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);
  }
@bidoubiwa bidoubiwa added the bug Something isn't working label Jun 21, 2023
@qdequele
Copy link
Member

No this code is not used. :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants