in reply to An (almost) useful idiom; needs work.
Yuk! ;^)
Btw, I write plenty of Yuk!TM code myself, it's just I don't start coding before I have an approach I like and then don't post code I'm not satisfied with yet, so you rarely get to see the yuck stuff. :) You'll notice that you are posting a fair bit more code than I do.
What I dislike here are two things: copypaste and parallel arrays.
I'm not sure what to propose to improve this, because my preferences would require quite a large reorganization and you'd end up with something very different that doesn't relate to the original issues much if at all anymore.
Compare my approach at Re: Finding first block of contiguous elements in an array. I chose to write a central loop that untangles multiline tags first, so that is taken care of centrally. A bunch of little handlers can then do whatever they like with the collected data.
Makeshifts last the longest.
|
|---|