Skip to content

Commit

Permalink
fix: #4, Adicionado um replace para substituir as aspas que é inserid…
Browse files Browse the repository at this point in the history
…o no IPhone, para a Unicode
  • Loading branch information
avuenja committed Aug 5, 2022
1 parent 66ba76a commit dc92fe6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gerador",
"version": "0.2.0",
"version": "0.2.1",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
4 changes: 3 additions & 1 deletion src/pages/json-pretty.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ const JsonPretty = () => {

const handlePrettify = () => {
try {
setPrettyJson(JSON.stringify(JSON.parse(json), null, 4))
const escapedJson = json.replace(/[]/g, '"')

setPrettyJson(JSON.stringify(JSON.parse(escapedJson), null, 4))
} catch (e) {
setIsInvalid(true)
}
Expand Down

1 comment on commit dc92fe6

@vercel
Copy link

@vercel vercel bot commented on dc92fe6 Aug 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.