cloudinary-community / cloudinary-community/next-cloudinary

[Bug] getCldOgImageUrl - Multiple commas in overlay text do not encode correctly, causing link to fail.

Open
#590 4 comments 0 reactions 1 assignee Claimed by @eportis-cloudinary View on GitHub
Dominant language
JavaScript
Stars
300
Forks
137
Avg merge
3m
Merged PRs (30d)
2

Description

# **Bug Report**

## **Describe the bug**

Using the social media card sample here: https://next.cloudinary.dev/templates/social-media-cards#one-third

Change the sample body text from this:
`const body = 'Get the power of Cloudinary in a Next.js project with Next Cloudinary!';`

to this (add two or more commas after get):
`const body = 'Get,, the power of Cloudinary in a Next.js project with Next Cloudinary!';`

The link produced will not display and return a 400 error.

## **Is this a regression?**

Don't know. Just started using this today.

## **Steps To Reproduce the error**

1. Set the text property of an overlay to any string with two or more commas (one works fine).
2. See above example using the social card templates from the documentation

## **Expected behaviour**
Image url should work, return a 200 okay status code, and display two or more commas correctly in the overlay.

## **CodeSandbox or Live Example of Bug**

## **Screenshot or Video Recording**

### **Your environment**

- OS:
- Node version:
- Npm version:
- Browser name and version:

## **Additional context**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.