View Single Post
Old 01-27-2014, 12:58 AM   #2
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,411
Karma: 27757236
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
It's not clear to me how such a feature would work robustly. Consider the following example:

Code:
<div>
  <div>
      <span class="heading">cursor</span>
  </div>
</div>
And you select the word cursor and trigger the h1 button. Which tag should be changed to h1? The first div, the second div or the span?

The best that can be done is to change the immediately surrounding tag, which means if you want to change the first div you need to put your cursor between the first and second divs, for the second div, between the second div and the span and so on.
kovidgoyal is offline   Reply With Quote