Regex to build nested html list

I love how TBX exports images in html. And I also love the quick Markdown syntax (esp. for lists). So I would like to combine both.

I wonder if it is possible to export a list (made with "- " (dash+space)) to html?
Unfortunately my regex skills are insufficient. But the Pseudo-Code should look like this:


Creating li-tags:

  1. FIND substring (=line) starting with "- " and ending with “\n”
  2. TAG this substring with <li>

Creating ul-tags:
3. FIND subtring starting with "<li> " and ending with </li> \n !</li> (closing li-tag at end of line, but no opening li-tag at beginning of next line)
4. TAG this substring with <ul>

The same code should work with the remaining nested lists (sublists), but instead regex is searching for text patterns starting with \t (tabulator).


Any comments if this is doable (or maybe already done) are welcome :wink:

I’d use Tinderbox’s own markup if you can bear it:

  • a list
    ** a nested list
    ** another item in the nested list
  • a second item

Yes, but I like the TBX HTML export functionalities with all its fine-tuning possibilities to create websites.
I’m looking for a way to increase my note-taking speed (without any hassle by thinking about formatting ): mainly pasting screenshots and text in lists (ordered, unordered, nested, untested), and some other tasks I already found solutions for.