The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Custom Formatting and Nested Lists

Hello,

I'm trying to create a content formatting function that will allow for nested lists. Basically where I'm stuck is the nested lists part . For every opening list tag, I want to find the correct closing list tag {to make sure it's there and to replace it with the correct HTML tag (<UL>,<OL>)}. How would I match the nested tags so it doesn't just find the first closing list tag that comes around, but finds the one that corresponds with the original opening tag. I hope I'm being clear enough.

Thanks for reading this and I hope you can help shed some light to as what I should do.