Skip to content

Commit

Permalink
Rename useHtmlParser2 option
Browse files Browse the repository at this point in the history
This flag is used to control parsing behavior internally, but it is not
intended for use by consumers. Prefix the name with an underscore in
order to discourage users from relying on it.
  • Loading branch information
jugglinmike committed Jul 2, 2017
1 parent 7c074d3 commit 8abf644
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/parse.js
Expand Up @@ -37,7 +37,7 @@ exports.evaluate = function(content, options, isDocument) {
content = content.toString();

if (typeof content === 'string') {
var useHtmlParser2 = options.xmlMode || options.useHtmlParser2;
var useHtmlParser2 = options.xmlMode || options._useHtmlParser2;

dom = useHtmlParser2 ? htmlparser.parseDOM(content, options) : parseWithParse5(content, isDocument);
} else {
Expand Down
2 changes: 1 addition & 1 deletion lib/utils.js
Expand Up @@ -62,7 +62,7 @@ exports.domEach = function(cheerio, fn) {
* @argument {Object} options - The parsing/rendering options
*/
exports.cloneDom = function(dom, options) {
options = assign({}, options, { useHtmlParser2: true });
options = assign({}, options, { _useHtmlParser2: true });

return parse(render(dom, options), options, false).children;
};
Expand Down

0 comments on commit 8abf644

Please sign in to comment.