Skip to content

Commit

Permalink
Merge pull request #3859 from ProjectMirador/mui5-span-tags
Browse files Browse the repository at this point in the history
Update annotation tags to avoid improperly nested HTML tags
  • Loading branch information
marlo-longley authored Dec 14, 2023
2 parents 36730ab + 40c9adc commit 5513b9d
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/components/CanvasAnnotations.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,17 @@ export class CanvasAnnotations extends Component {
onMouseEnter={() => this.handleAnnotationHover(annotation)}
onMouseLeave={this.handleAnnotationBlur}
>
<ListItemText primaryTypographyProps={{ variant: 'body2' }}>
<SanitizedHtml ruleSet={htmlSanitizationRuleSet} htmlString={annotation.content} />
<div>
{annotation.tags.map((tag) => (
<Chip size="small" variant="outlined" label={tag} id={tag} key={tag.toString()} />
))}
</div>
</ListItemText>
<ListItemText
primaryTypographyProps={{ variant: 'body2' }}
primary={
<SanitizedHtml ruleSet={htmlSanitizationRuleSet} htmlString={annotation.content} />
}
secondary={
annotation.tags.map((tag) => (
<Chip component="span" size="small" variant="outlined" label={tag} id={tag} key={tag.toString()} />
))
}
/>
</MenuItem>
</ScrollTo>
))}
Expand Down

0 comments on commit 5513b9d

Please sign in to comment.