Merge pull request #58 from Permissionless-Software-Foundation/dh-chat-markdown

feat(nostr): Added markdown support to Nostr Chat
This commit is contained in:
Chris Troutner
2025-08-30 05:18:25 -07:00
committed by GitHub
2 changed files with 6 additions and 4 deletions
@@ -6,6 +6,7 @@
import React, { useEffect, useRef, useState } from 'react'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faUser } from '@fortawesome/free-solid-svg-icons'
import NostrFormat from '../../app-body/nostr/nostr-format'
function MessageItem (props) {
const { message, profiles } = props
@@ -26,7 +27,7 @@ function MessageItem (props) {
if (!profile && profiles[message.pubkey]) {
setProfile(profiles[message.pubkey])
}
}, [profiles, message])
}, [profiles, message, profile])
useEffect(() => {
if (msgRef.current && message.latest) {
@@ -35,7 +36,7 @@ function MessageItem (props) {
block: 'end'
})
}
}, [msgRef.current, message])
}, [message])
return (
<div className='mb-3 d-flex align-items-start' ref={msgRef}>
@@ -86,7 +87,8 @@ function MessageItem (props) {
<small className='text-muted'>{formatTime(message.created_at * 1000)}</small>
</div>
<div style={{ lineHeight: '1.4', wordBreak: 'break-all' }}>
{message.content}
<NostrFormat content={message.content} />
</div>
</div>
</div>
+1 -1
View File
@@ -24,7 +24,7 @@ const config = {
'wss://nos.lol',
'wss://relay.damus.io'
],
chatsId: [
chatsId: [
'32b0ebc01c984008977fbe476e064946990df75525331b24b37bbba5e89f4039'
]