Skip to content

Commit

Permalink
FeaturePanel: display decoded link (#938)
Browse files Browse the repository at this point in the history
  • Loading branch information
zbycz authored Feb 6, 2025
1 parent 59fc41a commit 9979fce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/FeaturePanel/renderers/WebsiteRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import React from 'react';
import Language from '@mui/icons-material/Language';

const protocol = /^\w+:\/\//;
const fixHttp = (url) => (url.match(protocol) ? url : `http://${url}`);
const displayForm = (url) =>
url.replace(protocol, '').replace(/([^/]+)\/$/, '$1');
const fixHttp = (url: string) => (url.match(protocol) ? url : `http://${url}`);
const displayForm = (url: string) =>
decodeURI(url.replace(protocol, '').replace(/([^/]+)\/$/, '$1'));

const WebsiteRenderer = ({ v }) => (
<>
Expand Down

0 comments on commit 9979fce

Please sign in to comment.