Skip to content

Commit

Permalink
Update annotation tags to avoid improperly nested HTML tags
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Dec 13, 2023
1 parent 7c0af08 commit 40c9adc
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 40c9adc

Please sign in to comment.