mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 02:06:29 +00:00
extract html contentformatter
This commit is contained in:
@@ -23,7 +23,7 @@ import i18n from 'browser/lib/i18n'
|
||||
import fs from 'fs'
|
||||
import ConfigManager from '../main/lib/ConfigManager'
|
||||
|
||||
const { remote, shell } = require('electron')
|
||||
const { remote, shell, BrowserWindow } = require('electron')
|
||||
const attachmentManagement = require('../main/lib/dataApi/attachmentManagement')
|
||||
|
||||
const { app } = remote
|
||||
@@ -295,8 +295,7 @@ export default class MarkdownPreview extends React.Component {
|
||||
this.exportAsDocument('md')
|
||||
}
|
||||
|
||||
handleSaveAsHtml () {
|
||||
this.exportAsDocument('html', (noteContent, exportTasks) => {
|
||||
htmlContentFormatter (noteContent, exportTasks) {
|
||||
const {
|
||||
fontFamily,
|
||||
fontSize,
|
||||
@@ -347,12 +346,19 @@ export default class MarkdownPreview extends React.Component {
|
||||
</head>
|
||||
<body>${body}</body>
|
||||
</html>`
|
||||
})
|
||||
}
|
||||
|
||||
handleSaveAsHtml () {
|
||||
this.exportAsDocument('html', (noteContent, exportTasks) => this.htmlContentFormatter(noteContent, exportTasks))
|
||||
}
|
||||
|
||||
handleSaveAsPdf () {
|
||||
this.exportAsDocument('pdf', (noteContent, exportTasks) => {
|
||||
// Return pdf source
|
||||
// const doc = new jsPDF()
|
||||
// doc.fromHTML(this.markdown.render(noteContent), 0, 0)
|
||||
// return doc.output()
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user