mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 10:16:26 +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 fs from 'fs'
|
||||||
import ConfigManager from '../main/lib/ConfigManager'
|
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 attachmentManagement = require('../main/lib/dataApi/attachmentManagement')
|
||||||
|
|
||||||
const { app } = remote
|
const { app } = remote
|
||||||
@@ -295,8 +295,7 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
this.exportAsDocument('md')
|
this.exportAsDocument('md')
|
||||||
}
|
}
|
||||||
|
|
||||||
handleSaveAsHtml () {
|
htmlContentFormatter (noteContent, exportTasks) {
|
||||||
this.exportAsDocument('html', (noteContent, exportTasks) => {
|
|
||||||
const {
|
const {
|
||||||
fontFamily,
|
fontFamily,
|
||||||
fontSize,
|
fontSize,
|
||||||
@@ -347,12 +346,19 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
</head>
|
</head>
|
||||||
<body>${body}</body>
|
<body>${body}</body>
|
||||||
</html>`
|
</html>`
|
||||||
})
|
}
|
||||||
|
|
||||||
|
handleSaveAsHtml () {
|
||||||
|
this.exportAsDocument('html', (noteContent, exportTasks) => this.htmlContentFormatter(noteContent, exportTasks))
|
||||||
}
|
}
|
||||||
|
|
||||||
handleSaveAsPdf () {
|
handleSaveAsPdf () {
|
||||||
this.exportAsDocument('pdf', (noteContent, exportTasks) => {
|
this.exportAsDocument('pdf', (noteContent, exportTasks) => {
|
||||||
// Return pdf source
|
// 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