notion-content-render
Advanced tools
Comparing version 0.2.10 to 0.2.11
@@ -36,2 +36,3 @@ import type { Block, HeadingOneBlock, HeadingThreeBlock, HeadingTwoBlock, ParagraphBlock, RichText, ToDoBlock, ToggleBlock } from "@notionhq/client/build/src/api-types"; | ||
todo: (checked: boolean, content: R | undefined, block: ToDoBlock) => R; | ||
link: (content: R, href: string, block: RichText) => R; | ||
unsupported: (block: Block) => R; | ||
@@ -38,0 +39,0 @@ }; |
@@ -55,2 +55,5 @@ "use strict"; | ||
var content = styleFactory.text(richText.text.content); | ||
if (richText.href) { | ||
content = styleFactory.link(content, richText.href, richText); | ||
} | ||
if (formatters.length === 0) { | ||
@@ -57,0 +60,0 @@ return content; |
@@ -21,4 +21,5 @@ "use strict"; | ||
todo: function (checked, content) { return "[" + (checked ? "x" : " ") + "] " + content; }, | ||
link: function (children, href) { return "[" + children + "](href)"; }, | ||
unsupported: function () { return "unsupported"; } | ||
}; | ||
exports["default"] = MarkdownStyleFactory; |
@@ -76,4 +76,8 @@ "use strict"; | ||
}; }, | ||
link: function (Content, href) { return function () { | ||
return (react_1["default"].createElement("a", { href: href }, | ||
react_1["default"].createElement(Content, null))); | ||
}; }, | ||
unsupported: function () { return function () { return react_1["default"].createElement(react_1["default"].Fragment, null); }; } | ||
}; | ||
exports["default"] = ReactStyleFactory; |
{ | ||
"name": "notion-content-render", | ||
"version": "0.2.10", | ||
"version": "0.2.11", | ||
"description": "A library to render notion content structure to React or MD", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14683
259