mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
onlyoffice: support pdf documents
This commit is contained in:
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') {
|
||||
|
||||
Reference in new issue
Block a user