@blocksuite/editor
Advanced tools
Comparing version 0.3.0-20221229073953-c859d99 to 0.3.0-20221229170017-735c989
import TurndownService from 'turndown'; | ||
import { globalCSS, highlightCSS } from './exporter-style.js'; | ||
// Context: Lean towards breaking out any localizable content into constants so it's | ||
@@ -53,2 +54,13 @@ // easier to track content we may need to localize in the future. (i18n) | ||
}); | ||
turndownService.addRule('codeBlock', { | ||
filter: ['pre'], | ||
replacement: function (content, node) { | ||
const element = node; | ||
return ('```' + | ||
element.getAttribute('code-lang') + | ||
'\n' + | ||
node.textContent + | ||
'```\n'); | ||
}, | ||
}); | ||
const markdown = turndownService.turndown(htmlContent); | ||
@@ -64,11 +76,4 @@ const title = pageTitle?.trim() || UNTITLED_PAGE_NAME; | ||
<style> | ||
:root { | ||
--affine-primary-color: #3a4c5c; | ||
--affine-font-family: Avenir Next, apple-system, BlinkMacSystemFont, Helvetica Neue, Tahoma, PingFang SC, Microsoft Yahei, Arial, Hiragino Sans GB, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji; | ||
--affine-font-family2: Roboto Mono, apple-system, BlinkMacSystemFont, Helvetica Neue, Tahoma, PingFang SC, Microsoft Yahei, Arial, Hiragino Sans GB, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji; | ||
} | ||
body { | ||
font-family: var(--affine-font-family); | ||
color: var(--affine-primary-color); | ||
} | ||
${globalCSS} | ||
${highlightCSS} | ||
</style>`; | ||
@@ -75,0 +80,0 @@ // Question: Do we really need the extra div container? |
{ | ||
"name": "@blocksuite/editor", | ||
"version": "0.3.0-20221229073953-c859d99", | ||
"version": "0.3.0-20221229170017-735c989", | ||
"description": "Default BlockSuite-based editor built for AFFiNE.", | ||
@@ -11,4 +11,4 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@blocksuite/blocks": "0.3.0-20221229073953-c859d99", | ||
"@blocksuite/store": "0.3.0-20221229073953-c859d99", | ||
"@blocksuite/blocks": "0.3.0-20221229170017-735c989", | ||
"@blocksuite/store": "0.3.0-20221229170017-735c989", | ||
"lit": "^2.5.0", | ||
@@ -15,0 +15,0 @@ "marked": "^4.2.5", |
import TurndownService from 'turndown'; | ||
import { globalCSS, highlightCSS } from './exporter-style.js'; | ||
@@ -65,2 +66,15 @@ // Context: Lean towards breaking out any localizable content into constants so it's | ||
}); | ||
turndownService.addRule('codeBlock', { | ||
filter: ['pre'], | ||
replacement: function (content, node: Node) { | ||
const element = node as Element; | ||
return ( | ||
'```' + | ||
element.getAttribute('code-lang') + | ||
'\n' + | ||
node.textContent + | ||
'```\n' | ||
); | ||
}, | ||
}); | ||
const markdown = turndownService.turndown(htmlContent); | ||
@@ -77,11 +91,4 @@ const title = pageTitle?.trim() || UNTITLED_PAGE_NAME; | ||
<style> | ||
:root { | ||
--affine-primary-color: #3a4c5c; | ||
--affine-font-family: Avenir Next, apple-system, BlinkMacSystemFont, Helvetica Neue, Tahoma, PingFang SC, Microsoft Yahei, Arial, Hiragino Sans GB, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji; | ||
--affine-font-family2: Roboto Mono, apple-system, BlinkMacSystemFont, Helvetica Neue, Tahoma, PingFang SC, Microsoft Yahei, Arial, Hiragino Sans GB, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji; | ||
} | ||
body { | ||
font-family: var(--affine-font-family); | ||
color: var(--affine-primary-color); | ||
} | ||
${globalCSS} | ||
${highlightCSS} | ||
</style>`; | ||
@@ -88,0 +95,0 @@ // Question: Do we really need the extra div container? |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
262522
86
3219
+ Added@blocksuite/blocks@0.3.0-20221229170017-735c989(transitive)
+ Added@blocksuite/store@0.3.0-20221229170017-735c989(transitive)
- Removed@blocksuite/blocks@0.3.0-20221229073953-c859d99(transitive)
- Removed@blocksuite/store@0.3.0-20221229073953-c859d99(transitive)