Changeset 724:22b21a40da4e in hatta-dev for hatta.py


Ignore:
Timestamp:
01/10/10 20:36:38 (2 years ago)
Author:
Radomir Dopieralski <devel@…>
Branch:
default
Message:

make the html generated by the code highlighter validate -- use spans instead of divs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • hatta.py

    r723 r724  
    20182018            yield 0, '<div class="highlight"><pre>' 
    20192019            for lineno, line in source: 
    2020                 if line.strip(): 
    2021                     yield (lineno, 
    2022                            werkzeug.html.div(line.strip('\n'), id_="line_%d" % 
    2023                                              formatter.line_no)) 
    2024                 else: 
    2025                     yield (lineno, 
    2026                            werkzeug.html.div('&nbsp;', id_="line_%d" % 
    2027                                              formatter.line_no)) 
     2020                yield (lineno, 
     2021                       werkzeug.html.span(line, id_="line_%d" % 
     2022                                         formatter.line_no)) 
    20282023                formatter.line_no += 1 
    20292024            yield 0, '</pre></div>' 
     
    23652360document.getElementsByTagName('link');for(var i=0;i<m.length;++i){var n=m[i]; 
    23662361if(n.getAttribute('type')==='application/wiki'){l=n.getAttribute('href')}}if( 
    2367 l===''){return}var o=['p','h1','h2','h3','h4','h5','h6','pre','ul','div'];for( 
    2368 var j=0;j<o.length;++j){var m=document.getElementsByTagName(o[j]);for(var i=0; 
    2369 i<m.length;++i){var n=m[i];if(n.id&&n.id.match(/^line_\d+$/)){n.ondblclick= 
    2370 function(){var a=l+'#'+this.id.replace('line_','');document.location.href=a 
    2371 }}}}}}window.onload=function(){hatta_dates();hatta_edit()}""" 
     2362l===''){return}var o=['p','h1','h2','h3','h4','h5','h6','pre','ul','div', 
     2363'span'];for(var j=0;j<o.length;++j){var m=document.getElementsByTagName(o[j]); 
     2364for(var i=0;i<m.length;++i){var n=m[i];if(n.id&&n.id.match(/^line_\d+$/)){ 
     2365n.ondblclick=function(){var a=l+'#'+this.id.replace('line_',''); 
     2366document.location.href=a}}}}}} 
     2367window.onload=function(){hatta_dates();hatta_edit()}""" 
    23722368    style = """\ 
    23732369html { background: #fff; color: #2e3436; 
Note: See TracChangeset for help on using the changeset viewer.