taoqf / node-html-parser

A very fast HTML parser, generating a simplified DOM, with basic element query support.
MIT License
1.12k stars 112 forks source link

Why slug case and not camel case? #151

Closed drachehavoc closed 3 years ago

drachehavoc commented 3 years ago

The javascript pattern for methods, variables etc is camel case, but node-html-parser uses slug case.

my suggestion is to change to javascript pattern.

Before:

root.set_content('<li>Hello World</li>');

After:

root.setContent('<li>Hello World</li>');
taoqf commented 3 years ago
root.innerHTML = '<li>Hello World</li>';

may works for you. use set_content when you use second param options.