mirror of
https://github.com/Qortal/qortal-ui.git
synced 2025-04-17 08:35:54 +00:00
Fix post websites on q-chat
This commit is contained in:
parent
e33beb5e8a
commit
2cbaa7f0a3
@ -50,6 +50,7 @@ const extractComponents = async (url) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
url = url.replace(/^(qortal:\/\/)/, '');
|
url = url.replace(/^(qortal:\/\/)/, '');
|
||||||
|
|
||||||
if (url.startsWith('use-')) {
|
if (url.startsWith('use-')) {
|
||||||
// Handle the new 'use' format
|
// Handle the new 'use' format
|
||||||
let parts = url.split('/');
|
let parts = url.split('/');
|
||||||
@ -101,15 +102,13 @@ const extractComponents = async (url) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function processText(input) {
|
function processText(input) {
|
||||||
const linkRegex = /(qortal:\/\/\S+)/g;
|
const linkRegex = /(qortal:\/\/S+)/g;
|
||||||
|
|
||||||
function processNode(node) {
|
function processNode(node) {
|
||||||
if (node.nodeType === Node.TEXT_NODE) {
|
if (node.nodeType === Node.TEXT_NODE) {
|
||||||
const parts = node.textContent.split(linkRegex);
|
const parts = node.textContent.split(linkRegex);
|
||||||
|
if (parts.length > 0) {
|
||||||
if (parts.length > 1) {
|
|
||||||
const fragment = document.createDocumentFragment();
|
const fragment = document.createDocumentFragment();
|
||||||
|
|
||||||
parts.forEach((part) => {
|
parts.forEach((part) => {
|
||||||
if (part.startsWith('qortal://')) {
|
if (part.startsWith('qortal://')) {
|
||||||
const link = document.createElement('span');
|
const link = document.createElement('span');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user