
Security News
US Government Forces Anthropic to Pull Claude Fable Days After Launch
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.
notion-dom-parser
Advanced tools
a Javascript module which can parse notion post page to tree structure
English / 中文
Notion-dom-parser is a JavaScript npm open-source project for parsing the DOM structure of Notion article pages and converting it into a tree structure. This is particularly useful for developers looking to programmatically handle Notion content.
Install via npm:
npm install notion-dom-parser
const parser = require('notion-dom-parser');
const html = '';
const result = parser.parse(html);
import parser from 'notion-dom-parser';
const html = '';
const result = parser.parse(html);
Parser result is a tree-like array, each object is follow below structure
type NotionNode = {
type: string;
children: NotionNode[];
href?: string; // only when type is 'a', represent link of a
text?: string; // only when type is 'text', represent content of text node
olLevel?: number; // only when type is 'ol', represent list's level in nest relation
ulLevel?: number; // only when type is 'ul', represent list's level in nest relation
};
{
"type": "h1",
"children": [
{
"type": "text",
"text": "一级标题"
},
{
"type": "a",
"children": [
{
"type": "text",
"text": "链接"
}
],
"href": "/a8c83cfad753461585db3f063c24c13d?pvs=25"
}
]
}
{
"type": "p",
"children": [
{
"type": "text",
"text": "这里是正文,"
},
{
"type": "a",
"children": [
{
"type": "text",
"text": "链接"
}
],
"href": "http://www.baidu.com/"
},
{
"type": "text",
"text": "会生成脚注,重点请"
},
{
"type": "bold",
"children": [
{
"type": "text",
"text": "加粗,"
}
]
},
{
"type": "italic",
"children": [
{
"type": "text",
"text": "斜体,"
}
]
},
{
"type": "text",
"text": "代码"
},
{
"type": "p",
"children": [
{
"type": "text",
"text": "缩进"
}
]
}
]
}
{
"type": "quote",
"children": [
{
"type": "p",
"children": [
{
"type": "text",
"text": "这里是"
},
{
"type": "bold",
"children": [
{
"type": "text",
"text": "引用"
}
]
}
]
},
{
"type": "p",
"children": [
{
"type": "text",
"text": "拖进去的"
}
]
}
]
}
Contributions via GitHub pull requests are welcome. Please ensure you follow the project's coding standards and contribution guidelines before submitting.
This project is licensed under the MIT. For more information, please see the LICENSE file.
FAQs
a Javascript module which can parse notion post page to tree structure
The npm package notion-dom-parser receives a total of 3 weekly downloads. As such, notion-dom-parser popularity was classified as not popular.
We found that notion-dom-parser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.

Security News
A network of 152 Chrome live wallpaper extensions hid ad tracking and made extension-driven traffic look like Google search clicks.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.