You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GitHub's TOML includes line returns within arrays.
topics = [
"red",
"blue",
"green"
]
This hack removes line returns by brackets and commas:
data = data.replace(/[\n/g, '[') // Replace line return after bracket
data = data.replace(/[[ ]"/g, '["') // Replace [ then arbitrary amount of spaces then a quote
data = data.replace(/,\n[ ]/g, ',') // Replace comma following by line return and any amount of space
data = data.replace(/\n]/g, ']') // Replace line return before bracket
Resulting in one line in the incoming data:
topics = ["red","blue","green"]
But ideally the regex would reside in the toml.js file and only remove the line returns between brackets.
Thanks!
The text was updated successfully, but these errors were encountered:
GitHub's TOML includes line returns within arrays.
topics = [
"red",
"blue",
"green"
]
This hack removes line returns by brackets and commas:
data = data.replace(/[\n/g, '[') // Replace line return after bracket
data = data.replace(/[[ ]"/g, '["') // Replace [ then arbitrary amount of spaces then a quote
data = data.replace(/,\n[ ]/g, ',') // Replace comma following by line return and any amount of space
data = data.replace(/\n]/g, ']') // Replace line return before bracket
Resulting in one line in the incoming data:
topics = ["red","blue","green"]
But ideally the regex would reside in the toml.js file and only remove the line returns between brackets.
Thanks!
The text was updated successfully, but these errors were encountered: