Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New line in string value causing issues #3

Open
keithslater opened this issue Jan 6, 2020 · 2 comments
Open

New line in string value causing issues #3

keithslater opened this issue Jan 6, 2020 · 2 comments

Comments

@keithslater
Copy link

I am converting json to lua with the format method. My json has a string with a bunch of \n characters. When it runs through the converter, it changes the \n to actual new lines.

Ex.

"test": "one, two\n24982578,0\n25227524,10000000\n25334028,0\n25446352,10000000\n25447713,0\n25466455,10000000\n25467893,0\n25467972,10000000\n25469297,0\n25473686,10000000\n25474680,0\n25477985,10000000\n25480967,0\n25486622,10000000\n25488029,0\n25496669,10000000\n25497759,0\n25497842,10000000\n25547114,0\n25551549,10000000\n25554293,0\n25555323,10000000\n25556874,0\n25557190,10000000\n25568831,0\n25603246,10000000\n25632188,0\n25728228,10000000\n25888375,0",

Currently is converting to

test = "one,two
24982578,0
25227524,10000000
25334028,0
25446352,10000000
25447713,0
25466455,10000000
25467893,0
25467972,10000000
25469297,0
25473686,10000000
25474680,0
25477985,10000000
25480967,0
25486622,10000000
25488029,0
25496669,10000000
25497759,0
25497842,10000000
25547114,0
25551549,10000000
25554293,0
25555323,10000000
25556874,0
25557190,10000000
25568831,0
25603246,10000000
25632188,0
25728228,10000000
25888375,0",

Which isn't valid

@theBowja
Copy link

theBowja commented Jun 21, 2020

Can you try replacing all '\n' (one slash) with '\\n' (two slashes)? That might work.

@gakada
Copy link
Collaborator

gakada commented Jun 22, 2020

Yeah, I will take a look at this package again soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants