IonicaBizau/json2md

Small issue with lists

Stanzilla opened this issue · 4 comments

Hey there, I'm currently trying to create output like so:

output.push({ h1: "Collection" })
categories.forEach(cat => {
  output.push({ h2: cat.name })
  cat.files.forEach(file => {
    output.push({ ul: [ {link: { title: file.name, source: file.path }}]})
  })
})

Now, that is obviously adding a ul around every link, how would I .push the opening of an ul separate from the ending so I can keep my loop?

As far I remember, the lists are not interpreted deeply.

Sorry, actually they are.

I'm not sure what the problem is...

To explain my problem with that a bit more: It just adds a ton of new lines after every li this way.

Any workaround?