I told you exactly where the problem lies. It's in formatImages(). Was I unclear? You're using bs4 to parse single lines of an xhtml file with the assumption that they will always be self-contained, well-formed snippets of xhtml. Doing so will cause data-loss when it is not. The problematic line of code in LHS.xhtml will not parse without data-loss. In this case, the closing div tag in question gets clobbered.
Last edited by DiapDealer; 08-22-2017 at 09:40 PM.
|