8000 Remove duplicate NodeType definition by tushuhei · Pull Request #904 · google/budoux · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Remove duplicate NodeType definition #904

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

Merged
merged 1 commit into from
Feb 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions javascript/src/html_processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,6 @@ const defaultBlockElements = new Set([
'MARQUEE',
]);

// We could use `Node.TEXT_NODE` and `Node.ELEMENT_NODE` in a browser context,
// but we define the same here for Node.js environments.
const NODETYPE = {
ELEMENT: 1,
TEXT: 3,
};

/**
* Determine the action for a CSS `display` property value.
* @param display The value of the CSS `display` property.
Expand Down Expand Up @@ -414,7 +407,7 @@ export class HTMLProcessor {
*/
static hasChildTextNode(ele: HTMLElement) {
for (const child of ele.childNodes) {
if (child.nodeType === NODETYPE.TEXT) return true;
if (child.nodeType === NodeType.TEXT_NODE) return true;
}
return false;
}
Expand Down
0