mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
Chat html fix
This commit is contained in:
parent
98761a8e7d
commit
57a7ab9fb7
3 changed files with 17 additions and 10 deletions
|
@ -2,7 +2,7 @@ import React from 'react'
|
|||
import Head from 'next/head'
|
||||
import io from 'socket.io-client'
|
||||
|
||||
import linkifyHtml from 'linkify-html'
|
||||
import linkifyString from 'linkify-string'
|
||||
|
||||
import constants from '../constants.json'
|
||||
import LoadingIndicator from '../components/LoadingIndicator'
|
||||
|
@ -534,13 +534,20 @@ export default class Chat extends React.Component {
|
|||
|
||||
renderMsg(message, key) {
|
||||
const { msg, type } = message
|
||||
console.log(msg)
|
||||
console.log(
|
||||
linkifyString(msg, {
|
||||
defaultProtocol: 'https',
|
||||
target: '_blank',
|
||||
})
|
||||
)
|
||||
|
||||
if (type === 'text') {
|
||||
return (
|
||||
<div
|
||||
className={`${styles.messageEntry}`}
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: linkifyHtml(msg, {
|
||||
__html: linkifyString(msg, {
|
||||
defaultProtocol: 'https',
|
||||
target: '_blank',
|
||||
}),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue