Release v2.13.1
This commit is contained in:
+17
-2
@@ -101,7 +101,22 @@ function stripEditorOnlyMarkup(value) {
|
||||
}
|
||||
|
||||
function normalizeEditorMarkup(value) {
|
||||
return String(value === undefined || value === null ? '' : value).trim();
|
||||
return String(value === undefined || value === null ? '' : value)
|
||||
.replace(/https?:\/\/[^"'\s<>]+(\/media\/[^"'\s<>)]*)/gi, '$1')
|
||||
.trim();
|
||||
}
|
||||
|
||||
function normalizeEditorMediaReferences(value) {
|
||||
if (Array.isArray(value)) {
|
||||
return value.map(normalizeEditorMediaReferences);
|
||||
}
|
||||
if (value && typeof value === 'object') {
|
||||
Object.keys(value).forEach((key) => {
|
||||
value[key] = normalizeEditorMediaReferences(value[key]);
|
||||
});
|
||||
return value;
|
||||
}
|
||||
return typeof value === 'string' ? normalizeEditorMarkup(value) : value;
|
||||
}
|
||||
|
||||
async function fetchSlideById(pool, id) {
|
||||
@@ -507,7 +522,7 @@ async function buildTemplateContent(pool, template, body, filesByField, existing
|
||||
};
|
||||
}
|
||||
}
|
||||
return content;
|
||||
return normalizeEditorMediaReferences(content);
|
||||
}
|
||||
|
||||
async function buildSlidePayload(pool, req, existingSlide) {
|
||||
|
||||
Reference in New Issue
Block a user