Open hspagnolo opened 4 years ago
Hey there! Looks like a bug indeed, I'll try to figure out what's wrong and update the scripts. In the meantime, you can use the Collapse
script from the standard library, which joins lines with commas.
I modified the script and now it can run normally
/**
{
"api":1,
"name":"Join Lines With Comma",
"description":"Joins all lines with a comma.",
"author":"lybc",
"icon":"collapse",
"tags":"join, comma",
"bias": -0.1
}
**/
function main(state) {
state.fullText = state.fullText.split("\n").join(', ')
}
Thanks to both for your reply, I will test this ASAP. The 3 Trim scripts have also a bug I think, but I don't know how to solve them.
Nice day and regards Henri
I found a new problem, this string can not be json resolved.
[
{
"c": 125,
"day": "2020-07-22"
},
{
"c": 546,
"day": "2020-07-20"
},
{
"c": 652,
"day": "2020-07-14"
},
{
"c": 503,
"day": "2020-07-19"
},
{
"c": 552,
"day": "2020-07-17"
},
{
"c": 569,
"day": "2020-07-16"
},
{
"c": 540,
"day": "2020-07-15"
},
{
"c": 557,
"day": "2020-07-21"
},
{
"c": 678,
"day": "2020-07-13"
},
{
"c": 602,
"day": "2020-07-12"
},
{
"c": 540,
"day": "2020-07-18"
}
]
But it can be parsed elsewhere
Hey there!
Your json is made of non-breaking spaces as whitespaces, which is an invalid character in the JSON spec. You can see that by running url encode. Boop uses Javascriptcore's JSON tools and therefore we have no control over how the parsing gets done.
If you run the JSON minifier script first, it'll clean it up and get rid of those characters so you'll be able to format it properly!
Hey there!
Your json is made of non-breaking spaces as whitespaces, which is an invalid character in the JSON spec. You can see that by running url encode. Boop uses Javascriptcore's JSON tools and therefore we have no control over how the parsing gets done.
If you run the JSON minifier script first, it'll clean it up and get rid of those characters so you'll be able to format it properly!
OK, thank you for reply
Unfortunately, using JSON minifier first still did not resolve the same issue for me.
Hello,
First, thank you for Boop, great software.
I do not know what I may do wrong, but the scrips "join lines", "join lines with space" and "join lines with comma" only joins the first 2 lines, not the other ones?
Thanks and regards Henri