diff --git a/src/components/CanvasAnnotations.js b/src/components/CanvasAnnotations.js index e6ab55da85e93f9013b9523540b09f686fec2a5b..983d090c9d18e11ab06c28c58e80a6250591507f 100644 --- a/src/components/CanvasAnnotations.js +++ b/src/components/CanvasAnnotations.js @@ -58,7 +58,7 @@ export class CanvasAnnotations extends Component { render() { const { annotations, classes, index, label, selectedAnnotationIds, t, totalSize, - listContainerComponent, + listContainerComponent, htmlSanitizationRuleSet, } = this.props; if (annotations.length === 0) return <></>; @@ -84,7 +84,10 @@ export class CanvasAnnotations extends Component { onMouseLeave={this.handleAnnotationUnHighlight} > <ListItemText primaryTypographyProps={{ variant: 'body2' }}> - <SanitizedHtml ruleSet="iiif" htmlString={annotation.content} /> + <SanitizedHtml + ruleSet={htmlSanitizationRuleSet} + htmlString={annotation.content} + /> </ListItemText> </ListItem> )) @@ -106,6 +109,7 @@ CanvasAnnotations.propTypes = { classes: PropTypes.objectOf(PropTypes.string), deselectAnnotation: PropTypes.func.isRequired, highlightAnnotation: PropTypes.func.isRequired, + htmlSanitizationRuleSet: PropTypes.string, index: PropTypes.number.isRequired, label: PropTypes.string.isRequired, listContainerComponent: PropTypes.elementType, @@ -118,6 +122,7 @@ CanvasAnnotations.propTypes = { CanvasAnnotations.defaultProps = { annotations: [], classes: {}, + htmlSanitizationRuleSet: 'iiif', listContainerComponent: 'li', selectedAnnotationIds: [], }; diff --git a/src/config/settings.js b/src/config/settings.js index c2d5d9bafecaa18dd46587d929ff7765bd894049..a81460c6586aae9a6fdd51a1b2d5fdd9f58e82c2 100644 --- a/src/config/settings.js +++ b/src/config/settings.js @@ -215,6 +215,7 @@ export default { it: "Italiano", }, annotations: { + htmlSanitizationRuleSet: 'iiif', // See src/lib/htmlRules.js for acceptable values filteredMotivations: ['oa:commenting', 'sc:painting', 'commenting'], }, classPrefix: 'mirador', diff --git a/src/containers/CanvasAnnotations.js b/src/containers/CanvasAnnotations.js index 5b5a3986e303fe0e2664343caaee80856d7696f5..67d5a803f10a3da707c20dccee448681d2019e2f 100644 --- a/src/containers/CanvasAnnotations.js +++ b/src/containers/CanvasAnnotations.js @@ -32,6 +32,7 @@ const mapStateToProps = (state, { canvasId, windowId }) => ({ state, { canvasId, motivations: state.config.annotations.filteredMotivations, windowId }, ), ), + htmlSanitizationRuleSet: state.config.annotations.htmlSanitizationRuleSet, label: getCanvasLabel(state, { canvasId, windowId,