Stop means no. And no means no. So . . . stop.

Xander ,'Conversations with Dead People'


Buffistas Building a Better Board  

Do you have problems, concerns or recommendations about the technical side of the Phoenix? Air them here. Compliments also welcome.

To-do list


Jessica - Nov 19, 2002 5:12:13 pm PST #1650 of 10000
And then Ortus came and said "It's Ortin' time" and they all Orted off into the sunset

extra closing tags. Probably OK.

...unless one of them is t /table


John H - Nov 19, 2002 5:21:22 pm PST #1651 of 10000

Yeah this is just a check of formatting tags at the moment. The problem with table tags is you can't just count them, you have to validate a structure: TABLEs containing x number of TRs containing x number of TDs...

I think I might have to go back to that link with the full PHP parser...


Rob - Nov 19, 2002 5:25:43 pm PST #1652 of 10000

I bet that if you put in a close table tag for each open table tag, the board wouldn't be broken and all would be good. The message itself might look like crap, but we're not trying to solve that problem.

John, if you'll send me a copy of the test setup from your server, I'll take a whack at coding it up tonight.


John H - Nov 19, 2002 5:33:30 pm PST #1653 of 10000

I'm happy to try your solution on my site right now Rob, I'll play with it for a while and see what I come up with.

But now I'm looking for that post which mentioned some full HTML parsing module in PHP and I can't find it.


Rob - Nov 19, 2002 5:50:43 pm PST #1654 of 10000

It's Karl Thiessen "Buffistas Building a Better Board" Nov 18, 2002 3:07:13 am EST


Jesse - Nov 19, 2002 5:54:45 pm PST #1655 of 10000
Sometimes I trip on how happy we could be.

gaping openmouthed at Things I Don't Understand

cheering


John H - Nov 19, 2002 6:29:46 pm PST #1656 of 10000

OK, using Rob's model of reversing through the array of open ones and removing all which match a closing one, check out [link] -- and I'm going to lunch! Back in a while...


Rebecca Lizard - Nov 19, 2002 9:38:17 pm PST #1657 of 10000
You sip / say it's your crazy / straw say it's you're crazy / as you bicycle your soul / with beauty in your basket

You are all so goddam cool.


John H - Nov 19, 2002 9:46:50 pm PST #1658 of 10000

When are you going to learn PHP, Rebecca, and be like all the cool kids? t /peergrouppressure

OK, I've hit a snag.

I used Rob's model, which is:

each time you find an open tag, push it into the array. Each time you find a closing tag, search your array from the end going backwards until you find a matching open. Delete the matching open from the array.
At the end, walk the array backwards and emit one closing tag for each opening tag still in the array.

which works, but it works too well.

I've got two "for" loops:

for(all of our closing tags){
  for(all of our opening tags, in reverse order){
    if (closing tag matches opening tag){
      delete the opening tag;
    }
  }
}

so what happens when we're checking a close-font tag against a list which has two or more opening tags in it? It kills them both because we're iterating through the list.

What I need is to do this:

for(all of our closing tags){
  for(all of our opening tags, in reverse order){
    if (closing tag matches opening tag){
      delete the opening tag;
      next, but not in this loop, in the outer loop;
    }
  }
}

or, as usual, I'm missing something obvious and you're all laughing at me.

Can I do a "next in outer loop" in PHP? Or have I got a fundamentally silly structure?


§ ita § - Nov 19, 2002 9:48:01 pm PST #1659 of 10000
Well not canonically, no, but this is transformative fiction.

break should pop you out one loop.