View Single Post
Old 11-10-2013, 08:37 PM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,378
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I'm not sure how robust that can be made, without major efforts. As theducks points out, "preceded by" is not well defined in html. For example, all of the following snippets will render as paragraphs immediately preceded by a title:

Code:
<h1>title</h1>
<p>...

<h1>title</h1>
<div><div><p>

<h1>title</h1>
<table><td><p>...

<h1>t</h1>
<div><img src="blank.png"><p>

<h1>title</h1>
<p style="display:none or visibility:hidden"><p>...
So while it could be made to work for the common case of heading tag followed by simple <p> of <div>, it wont be particularly robust. And then there is the problem that it will require a separate option to control, since there will be people that like the current behavior.
kovidgoyal is offline   Reply With Quote