- public attachment links

- WIP
This commit is contained in:
Philipinho
2025-04-10 17:57:02 +01:00
parent b5c90ec775
commit 4f52d32bef
20 changed files with 713 additions and 402 deletions

View File

@ -15,10 +15,8 @@ import { StorageService } from '../storage/storage.service';
import {
buildTree,
computeLocalPath,
getAttachmentIds,
getExportExtension,
getPageTitle,
getProsemirrorContent,
PageExportTree,
replaceInternalLinks,
updateAttachmentUrls,
@ -29,6 +27,7 @@ import { EditorState } from '@tiptap/pm/state';
// eslint-disable-next-line @typescript-eslint/no-require-imports
import slugify = require('@sindresorhus/slugify');
import { EnvironmentService } from '../environment/environment.service';
import { getAttachmentIds, getProsemirrorContent } from '../../common/helpers/prosemirror/utils';
@Injectable()
export class ExportService {
@ -76,8 +75,11 @@ export class ExportService {
</html>`;
}
if (format === ExportFormat.Markdown) {
const newPageHtml = pageHtml.replace(/<colgroup[^>]*>[\s\S]*?<\/colgroup>/gmi, '');
if (format === ExportFormat.Markdown) {
const newPageHtml = pageHtml.replace(
/<colgroup[^>]*>[\s\S]*?<\/colgroup>/gim,
'',
);
return turndown(newPageHtml);
}
@ -260,14 +262,7 @@ export class ExportService {
const pages = await this.db
.selectFrom('pages')
.select([
'id',
'slugId',
'title',
'creatorId',
'spaceId',
'workspaceId',
])
.select(['id', 'slugId', 'title', 'creatorId', 'spaceId', 'workspaceId'])
.select((eb) => this.pageRepo.withSpace(eb))
.where('id', 'in', pageMentionIds)
.where('workspaceId', '=', workspaceId)