> > Unfortunately, fixing tag misalignment is a pretty hard problem if the parser itself doesn't expose that feature. > > Can you at least pinpoint line numbers even if the actual tags involved aren't identified? As I become more familiar with the code of this library, I might find out that it's doable without too much hassle. Obviously counting newlines comes to mind. But this library is implemented with regular expressions which are pretty opaque to work with. At least until I sit down and study it. I've been patching this library to provide validation errors and better tag implementations. If I don't watch out, it will've been more economical to've just written my own recursive descent or PEG parser, which is something I want to do anyways to vanquish BBCode once and for all. Imagine error metadata like: 'Expected [/b] on Line 10 Col 8 but found [/hider]'. And then exposing that to the user with some inline editor errors. Anyways, I'm definitely wasting time by obsessing over my error system. I mean, who cares. :lol