mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 09:38:19 +08:00
core: enhanced pdf support
This commit is contained in:
1 parent
ead0d54a55
commit
a3fb2cbd47
4 files changed
+5
-4
No files matched your search
@@ -103,7 +103,7 @@ module.exports = function videoPlugin(md) {
|
||||
pdf: videoUrl,
|
||||
};
|
||||
md.renderer.rules.video = function tokenizeReturn(tokens, idx) {
|
||||
const videoID = md.utils.escapeHtml(tokens[idx].videoID);
|
||||
let videoID = md.utils.escapeHtml(tokens[idx].videoID);
|
||||
const service = md.utils.escapeHtml(tokens[idx].service).toLowerCase();
|
||||
const checkUrl = /http(?:s?):\/\/(?:www\.)?[a-zA-Z0-9-:.]{1,}\/render(?:\/)?[a-zA-Z0-9.&;?=:%]{1,}url=http(?:s?):\/\/[a-zA-Z0-9 -:.]{1,}\/[a-zA-Z0-9]{1,5}\/\?[a-zA-Z0-9.=:%]{1,}/;
|
||||
let num;
|
||||
@@ -120,6 +120,7 @@ module.exports = function videoPlugin(md) {
|
||||
+ ' }); </script>';
|
||||
}
|
||||
if (service === 'pdf') {
|
||||
if (videoID.startsWith('file://')) videoID += '?noDisposition=1';
|
||||
return `\
|
||||
<object classid="clsid:${randomUUID().toUpperCase()}">
|
||||
<param name="SRC" value="${videoID}" >
|
||||
|
||||
Reference in new issue
Block a user