View Single Post
Old 07-19-2017, 03:44 PM   #161
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 DiapDealer View Post
There are however, situations where there's html code contained within comments that SmartyPants will barf hard on regardless. Fixing that might not be trivial, but I'd rather work on a solution that ignores ALL html comments entirely rather than slapping something together that only fixes this specific comment.
In theory, ignoring HTML comments should be simple. If "<!--" is found, scan ahead until "-->" or EOF is found, and ignore everything in between: HTML code, equations, scripts, whatever. Of course, depending on how the algorithm in this instance is designed, "scan ahead" may not be feasible.

Maybe a preprocessing pass that removes comments to store them in a list somewhere, then a post pass that puts them back? (I'm really just spitballing here, having not looked at the code.)
Rev. Bob is offline   Reply With Quote