Linkify urls in album comments. Fixes #1053, supersedes #1570 and #1169

Simple approach, may be extended/enhanced in the future.
This commit is contained in:
Deluan
2022-10-06 23:46:30 -04:00
parent fa5dc5af10
commit c530ccf138
2 changed files with 75 additions and 1 deletions
+2 -1
View File
@@ -33,6 +33,7 @@ import {
import config from '../config'
import { intersperse } from '../utils'
import AlbumExternalLinks from './AlbumExternalLinks'
import AnchorMe from '../common/AnchorMe'
const useStyles = makeStyles(
(theme) => ({
@@ -116,7 +117,7 @@ const AlbumComment = ({ record }) => {
const formatted = useMemo(() => {
return lines.map((line, idx) => (
<span key={record.id + '-comment-' + idx}>
<span dangerouslySetInnerHTML={{ __html: line }} />
<AnchorMe text={line} />
<br />
</span>
))