mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
server-ts: Fix build errors
This commit is contained in:
parent
0daa4cc89a
commit
e96b56e061
@ -7,7 +7,7 @@ import importUtils = require('./utils');
|
|||||||
function renderToHtml(content: string, title: string) {
|
function renderToHtml(content: string, title: string) {
|
||||||
const html = marked.parse(content, {
|
const html = marked.parse(content, {
|
||||||
async: false
|
async: false
|
||||||
}); // FIXME: mangle and headerIds does not seem to exist in marked
|
}) as string; // FIXME: mangle and headerIds does not seem to exist in marked
|
||||||
const h1Handled = importUtils.handleH1(html, title); // h1 handling needs to come before sanitization
|
const h1Handled = importUtils.handleH1(html, title); // h1 handling needs to come before sanitization
|
||||||
return htmlSanitizer.sanitize(h1Handled);
|
return htmlSanitizer.sanitize(h1Handled);
|
||||||
}
|
}
|
||||||
|
@ -1,18 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
import { TaskData } from './task_context_interface';
|
||||||
import ws = require('./ws');
|
import ws = require('./ws');
|
||||||
|
|
||||||
// taskId => TaskContext
|
// taskId => TaskContext
|
||||||
const taskContexts: Record<string, TaskContext> = {};
|
const taskContexts: Record<string, TaskContext> = {};
|
||||||
|
|
||||||
interface TaskData {
|
|
||||||
safeImport?: boolean;
|
|
||||||
textImportedAsText?: boolean;
|
|
||||||
codeImportedAsCode?: boolean;
|
|
||||||
shrinkImages?: boolean;
|
|
||||||
replaceUnderscoresWithSpaces?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
class TaskContext {
|
class TaskContext {
|
||||||
|
|
||||||
private taskId: string;
|
private taskId: string;
|
||||||
|
7
src/services/task_context_interface.ts
Normal file
7
src/services/task_context_interface.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
export interface TaskData {
|
||||||
|
safeImport?: boolean;
|
||||||
|
textImportedAsText?: boolean;
|
||||||
|
codeImportedAsCode?: boolean;
|
||||||
|
shrinkImages?: boolean;
|
||||||
|
replaceUnderscoresWithSpaces?: boolean;
|
||||||
|
}
|
@ -12,6 +12,8 @@ import AbstractBeccaEntity = require('../becca/entities/abstract_becca_entity');
|
|||||||
import env = require('./env');
|
import env = require('./env');
|
||||||
import { IncomingMessage, Server } from 'http';
|
import { IncomingMessage, Server } from 'http';
|
||||||
import { EntityChange } from './entity_changes_interface';
|
import { EntityChange } from './entity_changes_interface';
|
||||||
|
import { TaskData } from './task_context_interface';
|
||||||
|
|
||||||
if (env.isDev()) {
|
if (env.isDev()) {
|
||||||
const chokidar = require('chokidar');
|
const chokidar = require('chokidar');
|
||||||
const debounce = require('debounce');
|
const debounce = require('debounce');
|
||||||
@ -28,10 +30,9 @@ let lastSyncedPush: number | null = null;
|
|||||||
|
|
||||||
interface Message {
|
interface Message {
|
||||||
type: string;
|
type: string;
|
||||||
data?: {
|
data?: TaskData | null | {
|
||||||
lastSyncedPush?: number | null,
|
lastSyncedPush?: number | null,
|
||||||
entityChanges?: any[],
|
entityChanges?: any[],
|
||||||
safeImport?: boolean
|
|
||||||
},
|
},
|
||||||
lastSyncedPush?: number | null,
|
lastSyncedPush?: number | null,
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user