mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
pretty printing HTML output (for nice git diffs)
This commit is contained in:
parent
ddd216c92e
commit
41f089b3f4
8
package-lock.json
generated
8
package-lock.json
generated
@ -4264,6 +4264,14 @@
|
||||
"resolved": "https://registry.npmjs.org/hsts/-/hsts-2.1.0.tgz",
|
||||
"integrity": "sha512-zXhh/DqgrTXJ7erTN6Fh5k/xjMhDGXCqdYN3wvxUvGUQvnxcFfUd8E+6vLg/nk3ss1TYMb+DhRl25fYABioTvA=="
|
||||
},
|
||||
"html": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/html/-/html-1.0.0.tgz",
|
||||
"integrity": "sha1-pUT6nqVJK/s6LMqCEKEL57WvH2E=",
|
||||
"requires": {
|
||||
"concat-stream": "1.6.0"
|
||||
}
|
||||
},
|
||||
"html-comment-regex": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/html-comment-regex/-/html-comment-regex-1.1.1.tgz",
|
||||
|
@ -25,6 +25,7 @@
|
||||
"express-session": "^1.15.6",
|
||||
"fs-extra": "^4.0.2",
|
||||
"helmet": "^3.9.0",
|
||||
"html": "^1.0.0",
|
||||
"ini": "^1.3.4",
|
||||
"request": "^2.83.0",
|
||||
"request-promise": "^4.2.2",
|
||||
|
@ -6,6 +6,7 @@ const rimraf = require('rimraf');
|
||||
const fs = require('fs');
|
||||
const sql = require('../../services/sql');
|
||||
const data_dir = require('../../services/data_dir');
|
||||
const html = require('html');
|
||||
|
||||
router.get('/:noteId/to/:directory', async (req, res, next) => {
|
||||
const noteId = req.params.noteId;
|
||||
@ -36,7 +37,7 @@ async function exportNote(noteTreeId, dir) {
|
||||
|
||||
const pos = (noteTree.note_pos + '').padStart(4, '0');
|
||||
|
||||
fs.writeFileSync(dir + '/' + pos + '-' + note.note_title + '.html', note.note_text);
|
||||
fs.writeFileSync(dir + '/' + pos + '-' + note.note_title + '.html', html.prettyPrint(note.note_text, {indent_size: 2}));
|
||||
|
||||
const children = await sql.getResults("SELECT * FROM notes_tree WHERE note_pid = ? AND is_deleted = 0", [note.note_id]);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user