Merge branch 'develop' into activitypub

This commit is contained in:
Julian Lam
2024-05-23 15:18:56 -04:00

View File

@@ -27,13 +27,10 @@ let sanitizeConfig = {
source: ['type', 'src', 'srcset', 'sizes', 'media', 'height', 'width'],
embed: ['height', 'src', 'type', 'width'],
},
globalAttributes: ['accesskey', 'class', 'contenteditable', 'dir',
nonBooleanAttributes: ['accesskey', 'class', 'contenteditable', 'dir',
'draggable', 'dropzone', 'hidden', 'id', 'lang', 'spellcheck', 'style',
'tabindex', 'title', 'translate', 'aria-expanded', 'data-*',
'tabindex', 'title', 'translate', 'aria-*', 'data-*',
],
allowedClasses: {
...sanitize.defaults.allowedClasses,
},
};
const allowedTypes = new Set(['default', 'plaintext', 'activitypub.note', 'activitypub.article']);
@@ -133,7 +130,7 @@ module.exports = function (Posts) {
sanitizeConfig.allowedTags.forEach((tag) => {
sanitizeConfig.allowedAttributes[tag] = _.union(
sanitizeConfig.allowedAttributes[tag],
sanitizeConfig.globalAttributes
sanitizeConfig.nonBooleanAttributes
);
});