View Single Post
Old 08-25-2015, 03:16 AM   #990
Rev. Bob
Wizard
Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.
 
Rev. Bob's Avatar
 
Posts: 1,760
Karma: 9918418
Join Date: Feb 2013
Location: Here on the perimeter, there are no stars
Device: Kobo H2O, iPad mini 3, Kindle Touch
Quote:
Originally Posted by chrisridd View Post
Attached are the two files from the original mangled run.
I think I see the problem, and it should be an easy fix. Not to get too detailed, but I believe the current code uses one line to look for three patterns, with the middle one mandatory and the outer ones optional. The trouble is, the outer ones are supposed to be optional together, not separately - and in these cases, one of the outer patterns (the closing /DIV) gets detected without the other (the opening DIV). The code then removes the anchor and closing tag, thus creating a mismatch.

If that's correct, I just need to adjust the code to make it two lines instead of one: one with the anchor enclosed by the DIV tags (not optional), followed by one with just the anchor. Since neither new pattern allows for a mismatch, the problem should be solved.

I should get a chance to look into that tomorrow (er, later today) sometime - thanks for the useful bug report!
Rev. Bob is offline   Reply With Quote