so basically, what I've got is a handful of BBC text like such:
[tree]title0
[node]title1
title2
[node]title3
title4
title5[/node][/node]
title6
title7[/tree]
using JS, how could I parse this to get this into this??
[ title0, [ title1, title2, [ title3, title4, title5 ] ], title6, title7 ]
what I intend to do is use functions recursively and return the html-text of the parsed nodes
reason for recursive functions is for telling which nodes (single or sub-tree) are the last nodes in each level
(I need a different image displayed so it doesn't draw a line where there should be no line)
thanx for any and all help :)
EDIT: note: title0 and title1 are on the same level (along with titles 6 and 7)
title0 is a single node
title1 is an expandable node with 2 sub-nodes (title2 and title3)