mirror of
https://github.com/GitSquared/edex-ui.git
synced 2024-09-21 10:37:29 +00:00
Fix media with hashtags in their filenames (#745)
This commit is contained in:
parent
8a7f064b77
commit
54ddb18de3
@ -13,6 +13,9 @@ window._escapeHtml = text => {
|
||||
};
|
||||
return text.replace(/[&<>"']/g, m => {return map[m];});
|
||||
};
|
||||
window._encodePathURI = uri => {
|
||||
return encodeURI(uri).replace(/#/g, "%23");
|
||||
};
|
||||
window._purifyCSS = str => {
|
||||
if (typeof str === "undefined") return "";
|
||||
if (typeof str !== "string") {
|
||||
|
@ -548,11 +548,11 @@ class FilesystemDisplay {
|
||||
|
||||
switch(type || block.type) {
|
||||
case "image":
|
||||
html = `<img class="fsDisp_mediaDisp" src="${path || block.path}" ondragstart="return false;">`;
|
||||
html = `<img class="fsDisp_mediaDisp" src="${window._encodePathURI(path || block.path)}" ondragstart="return false;">`;
|
||||
break;
|
||||
case "video":
|
||||
html = `<video class="fsDisp_mediaDisp" controls preload="auto">
|
||||
<source src="${path || block.path}">
|
||||
<source src="${window._encodePathURI(path || block.path)}">
|
||||
Unsupported video format!
|
||||
</video>`;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user