View Single Post
Old 08-22-2017, 09:11 PM   #221
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
@DiapDealer and @Doitsu...Thanks for testing and for your opinions.

You are both right -- it isn't the BS html parser causing the problem. I did some further checks to confirm this. After I ran the plugin I then checked the plugin working directory containing all the epub files. When I ran the LHS.xhtml(in the working directory) in Chrome and looked at the source code this showed the same missing div error as before. So this does seem to confirm that this problem is somewhere in my plugin code.

To help confirm the problem area in my code, I think it would perhaps be helpful if I show recently added functions that are not involved with the missing div problem.

I have recently added the following functions to my code:

reformatImageLayout()
fixBrokenTags()

I added these two functions in after getting the missing div tag error. I decided to initially reformat the div tags as a possible way of curing the missing div problem and standardize the input. Similarly, I wrote a regex function that repaired broken tags to fix this problem.These two functions made no difference regarding this problem(ie they have neither caused nor cured the problem). The only function that actually formats div tags in the plugin is the reformatImageLayout() function and, as I've already said, that function was added in as a possible fix after I started getting the missing div problem in GG's epub.

I've also thoroughly checked my plugin code and there is nowhere else in the plugin code where the code changes or removes div tags. So I am still in the dark as to why the plugin code only gives one missing div tag error on line 322 of the LHS.xhtml file while the other images in GG's epub, which are all formatted in exactly the same way as the image with the missing div tag, have no missing div tag errors. This fact would seem to actually contradict the belief that it is the plugin code that is causing the single missing div tag problem because if it was my code then wouldn't all the aforementioned images have the same missing div tag problem as well? After all, couldn't this missing div problem also be due to a problem in a used module or a wrapping problem that really has nothing to do with my actual plugin code?

I might try using libtidy to confirm whether missing div tag error is a wrapping problem. As I've already said, this isn't going to be an easy error to locate or fix. So later I will try adding Tidy with the wrap option set to OFF in the plugin to see if this cures the problem. Can't do it now -- I have to dash off again.

Last edited by slowsmile; 08-22-2017 at 09:46 PM.
slowsmile is offline   Reply With Quote