onlyoffice: support pdf documents

This commit is contained in:
undefined committed 2024-09-26 06:26:28 +08:00
1 parent 520c75d1d1
commit dcbca065e5
6 files changed
+38 -24

No files matched your search

@@ -83,7 +83,7 @@ function resourceUrl(service: string, src: string, url: string) {
declare module 'hydrooj' {
interface ModuleInterfaces {
richmedia: {
get: (src: string) => string | null;
get: (service: string, src: string, md: MarkdownIt) => string | null;
}
}
}
@@ -94,7 +94,7 @@ export function Media(md: MarkdownIt) {
let src = md.utils.escapeHtml(tokens[idx].attrGet('src'));
const service = md.utils.escapeHtml(tokens[idx].attrGet('service')).toLowerCase();
if (Hydro.module.richmedia?.[service]) {
const result = Hydro.module.richmedia[service].get(src);
const result = Hydro.module.richmedia[service].get(service, src, md);
if (result) return result;
}
if (service === 'pdf') {