Skip to content

100% cpu while parsing document #260

@papirosko

Description

@papirosko

simple code hangs causing kube to kill pod:

import {parse} from 'node-html-parser';
const html = // load https://www.a1supplements.com/
const root = parse(html);

I use:

    "node-html-parser": "^6.1.10",

host: https://www.a1supplements.com/
html size: 4620497 symbols

I have these from node inspect:

break in node_modules/node-html-parser/dist/nodes/html.js:1192
 1190                     oneBefore.removeChild(last);
 1191                     last.childNodes.forEach(function (child) {
>1192                         oneBefore.appendChild(child);
 1193                     });
 1194                 }

The contents (in case the website will be updated):

a1supplements.com.html.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions