mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-07-23 04:36:52 +00:00
bug fix
This commit is contained in:
@@ -3,12 +3,13 @@ import DOMPurify from 'dompurify';
|
||||
import './styles.css'; // Ensure this CSS file is imported
|
||||
|
||||
export const MessageDisplay = ({ htmlContent }) => {
|
||||
|
||||
const linkify = (text) => {
|
||||
// Regular expression to find URLs starting with https://, http://, or www.
|
||||
const urlPattern = /(\bhttps?:\/\/[^\s<]+|\bwww\.[^\s<]+)/g;
|
||||
|
||||
// Replace plain text URLs with anchor tags
|
||||
return text.replace(urlPattern, (url) => {
|
||||
return text?.replace(urlPattern, (url) => {
|
||||
const href = url.startsWith('http') ? url : `https://${url}`;
|
||||
return `<a href="${href}" class="auto-link">${DOMPurify.sanitize(url)}</a>`;
|
||||
});
|
||||
|
Reference in New Issue
Block a user