1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-30 10:36:35 +02:00

Merge branch 'dev' into release-2.4

This commit is contained in:
Laurent Cozic 2021-09-02 18:48:43 +01:00
commit e387d9a91b
3 changed files with 8 additions and 7 deletions

View File

@ -73,6 +73,7 @@ describe('shares.link', function() {
expect(bodyHtml).toContain('rendered-md'); // Means we have the HTML body
expect(bodyHtml).toContain('Testing title'); // Means the note has been rendered
expect(bodyHtml).toContain('Testing body');
expect(bodyHtml).toContain('<title>Testing title'); // Means the page title is set to the note title
});
test('should load plugins', async function() {

View File

@ -18,6 +18,7 @@ export interface RenderOptions {
export interface View {
name: string;
title: string;
titleOverride?: boolean;
path: string;
layout?: string;
navbar?: boolean;
@ -187,7 +188,7 @@ export default class MustacheService {
const layoutView: any = {
global: globalParams,
pageName: view.name,
pageTitle: `${config().appName} - ${view.title}`,
pageTitle: view.titleOverride ? view.title : `${config().appName} - ${view.title}`,
contentHtml: contentHtml,
cssFiles: cssFiles,
jsFiles: jsFiles,

View File

@ -1,5 +1,4 @@
import JoplinDatabase from '@joplin/lib/JoplinDatabase';
// import Logger from '@joplin/lib/Logger';
import BaseModel, { ModelType } from '@joplin/lib/BaseModel';
import BaseItem from '@joplin/lib/models/BaseItem';
import Note from '@joplin/lib/models/Note';
@ -25,6 +24,8 @@ import Setting from '@joplin/lib/models/Setting';
import { Models } from '../models/factory';
import MustacheService from '../services/MustacheService';
import Logger from '@joplin/lib/Logger';
import config from '../config';
const { substrWithEllipsis } = require('@joplin/lib/string-utils');
const logger = Logger.create('JoplinUtils');
@ -81,9 +82,6 @@ export async function initializeJoplinUtils(config: Config, models: Models, must
BaseItem.loadClass('NoteTag', NoteTag);
BaseItem.loadClass('MasterKey', MasterKey);
BaseItem.loadClass('Revision', Revision);
// mustache_ = new MustacheService(config.viewDir, config.baseUrl);
// mustache_.prefersDarkEnabled = false;
}
export function linkedResourceIds(body: string): string[] {
@ -148,7 +146,7 @@ async function noteLinkedItemInfos(userId: Uuid, itemModel: ItemModel, note: Not
output[jopId] = {
item: itemModel.itemToJoplinItem(item),
file: null,// itemFileWithContent.file,
file: null,
};
}
@ -213,7 +211,8 @@ async function renderNote(share: Share, note: NoteEntity, resourceInfos: Resourc
cssFiles: ['items/note'],
jsFiles: ['items/note'],
name: 'note',
title: 'Note',
title: `${substrWithEllipsis(note.title, 0, 100)} - ${config().appName}`,
titleOverride: true,
path: 'index/items/note',
content: {
note: {