Skip to content

Commit

Permalink
Merge pull request #182 from SnickerdoodleLabs/fix/metatdata-encoding
Browse files Browse the repository at this point in the history
fix: regex for different formats
  • Loading branch information
fatihtoker authored Aug 11, 2022
2 parents 8ebd327 + b9f3d3d commit 43441f2
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ const NFTItem: FC<INFTItemProps> = ({ item }: INFTItemProps) => {
const classes = useStyles();

const nftImages = useMemo((): string[] => {
const regexpImage = /(\"image.*?\":\s*?\"(\s*?.*?\s*?)\")/;
const regexpUrl =
/(https?|ipfs):\/\/([-A-Z0-9.]+)(\/[-A-Z0-9+&@#\/%=~_|!:,.;]*)/i;
const regexpImage = /(\"image.*?\":.*?\"(.*?)\\?\")/;
const regexpUrl = /(https?|ipfs)/i;
const splittedData = item.metadata?.split(regexpImage);
const extractedImages: string[] = [];
splittedData?.forEach((key) => {
Expand Down

0 comments on commit 43441f2

Please sign in to comment.