function pluginListToGrid(txt){
let ret = {}
let txt2 = []
let gridactive = false
let collimit = -1
let indentraw = 0
let space = 2
let indentstart = 0
txt.split("\n").map(line => {
if (line.trim() == "") return
if (line.includes('crash_grid')){
gridactive = true
collimit = +line.trim().split(" ")[1]
indentraw = getlvl(line)
indentstart = -1
console.log(gridactive, collimit, indentraw)
return
}
if (gridactive){
if (getlvl(line) < indentraw){
gridactive = false
txt2.push(line)
return
}
if (line.trim().startsWith('-')){
indentstart += 1
if (indentstart == collimit)
indentstart = 0
}
let pre = ''
for (let i = 0; i < indentraw+indentstart*space; i++)
pre += ' '
txt2.push(pre+line.trim())
}else{
txt2.push(line)
}
})
ret = txt2.join("\n")
return ret
}