BioDrop icon indicating copy to clipboard operation
BioDrop copied to clipboard

Testimonials with multiple lines breaks the json

Open eddiejaoude opened this issue 3 years ago • 7 comments

Description

We need to fix multi line testimonials that are submitted from the GitHub Issue with type testimonial

Currently these will not get created, so we have some basic protection from incorrect json files being committed

Screenshots

No response

Additional information

No response

eddiejaoude avatar Jan 04 '23 12:01 eddiejaoude

It's great having you contribute to this project

Welcome to the community :nerd_face:

If you would like to continue contributing to open source and would like to do it with an awesome inclusive community, you should join our Discord chat and our GitHub Organisation - we help and encourage each other to contribute to open source little and often 🤓 . Any questions let us know.

github-actions[bot] avatar Jan 04 '23 12:01 github-actions[bot]

Can you provide examples of working and broken text. Would the broken text be correct JSON if formatted correctly?

dan-mba avatar Jan 04 '23 15:01 dan-mba

Good point @dan-mba , I think it is anything with line breaks, but this is the issue I used that caused it to break (I borrowed the testimonial from someone else and I saw the GitHub Action break)

https://github.com/EddieHubCommunity/LinkFree/issues/2665

and this was the GitHub Action

https://github.com/EddieHubCommunity/LinkFree/actions/runs/3837855231/jobs/6533636414

eddiejaoude avatar Jan 04 '23 15:01 eddiejaoude

There is a bigger problem with the conversion of this particular issue to JSON than newlines. It has un-escaped " characters. This completely breaks JSON.

I am not sure if the newlines will be a problem if this is fixed, but I will take a look at it

dan-mba avatar Jan 04 '23 15:01 dan-mba

After further research, steps.issue-parser.outputs.issueparser_description needs to be modified before being put into JSON. The " needs to be changed to \" And newlines need to be changed to the string literal \n

dan-mba avatar Jan 04 '23 16:01 dan-mba

Ah yes good points Dan 👍 thank you for researching

eddiejaoude avatar Jan 04 '23 21:01 eddiejaoude

Is there maybe a linter that will fix the input?

murraybot avatar Jan 07 '23 16:01 murraybot