Re: phps line numbering

From: Date: Fri, 17 Mar 2006 02:16:51 +0000
Subject: Re: phps line numbering
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-22490@lists.php.net to get a copy of this message
Not sure if it's a prefect solution, but this could easily be done: <script type="text/javascript"> function hideNumbers() { var lists = document.getElementsByTagName('ol'); for (var i =0;i<lists.length;i++) {
       if (!lists[i].getAttribute('isphplist')) {
           continue;
       }
             var lis = lists[i].getElementsByTagName('li');
             for (var j =0;j<lis.length;i++) {
                      var ns = document.createElement('div');
           ns.innerHTML  = lis[j].innerHTML;
           lis[j].parentNode.replaceChild(ns, lis[j]);
                 }
       var ns = document.createElement('div');
       ns.innerHTML = lists[i].innerHTML ;
       lists[i].parentNode.replaceChild(ns, lists[i]);     }
  }
</script> Jared Williams wrote:
Jared Williams wrote:
Replacing the list, with divs and using css generated content to display the line numbers, cleans up the paste output but won't get
     
... and doesn't work in IE. So no real win here. The semantic solution would be to use ol/li .
Can't use ol/li thou, as that is what messes up the cut & paste in FF. Even if you use conditional CSS, set the list-style to none, and use css generated content to inject the line numbers, when it cut & pastes, FF forgets the list-style none, and still includes junk. Jared


« previous php.internals (#22490) next »