Attachment 'moin-html401.txt'

Download

   1 --- MoinMoin/formatter/text_html.py.orig	2006-02-03 22:25:29.000000000 +0100
   2 +++ MoinMoin/formatter/text_html.py	2006-02-16 22:52:01.176619922 +0100
   3 @@ -27,7 +27,7 @@
   4  # when they don't have a closing tag even if valid XHTML.
   5  
   6  _self_closing_tags = Set(['area', 'base', 'br', 'col', 'frame', 'hr', 'img', 'input',
   7 -                          'isindex', 'link', 'meta', 'param'])
   8 +                          'isindex', 'link', 'meta', 'param', 'p'])
   9  
  10  # These are the elements which generally should cause an increase in the
  11  # indention level in the html souce code.
  12 @@ -1083,6 +1083,23 @@
  13  
  14      # Lists ##############################################################
  15  
  16 +    def _ol_css(self, type):
  17 +
  18 +        if type == '1':
  19 +            ret = 'decimal'
  20 +        elif type == 'a':
  21 +            ret = 'lower-latin'
  22 +        elif type == 'A':
  23 +            ret = 'upper-latin'
  24 +        elif type == 'i':
  25 +            ret = 'lower-roman'
  26 +        elif type == 'I':
  27 +            ret = 'upper-roman'
  28 +        else:
  29 +            raise ValueError, type
  30 +        return 'list-style-type: %s' % ret
  31 +    
  32 +
  33      def number_list(self, on, type=None, start=None, **kw):
  34          """Creates an HTML ordered list, <ol> element.
  35  
  36 @@ -1099,7 +1116,7 @@
  37          if on:
  38              attr = {}
  39              if type is not None:
  40 -                attr['type'] = type
  41 +                attr['style'] = self._ol_css(type)
  42              if start is not None:
  43                  attr['start'] = start
  44              tagstr = self._open(tag, newline=1, attr=attr, **kw)
  45 --- MoinMoin/parser/wiki.py.orig	2006-02-16 22:07:22.786557495 +0100
  46 +++ MoinMoin/parser/wiki.py	2006-02-16 22:50:56.443856172 +0100
  47 @@ -742,6 +742,7 @@
  48  
  49              # return the complete cell markup
  50              result.append(self.formatter.table_cell(1, attrs) + attrerr)         
  51 +            result.append(self._line_anchordef())
  52              return ''.join(result) 
  53          else:
  54              return self.formatter.text(word)
  55 @@ -916,6 +917,13 @@
  56  
  57          return ""
  58  
  59 +    def _line_anchordef(self):
  60 +        if self.line_anchors and not self.line_anchor_printed:
  61 +            self.line_anchor_printed = 1
  62 +            return self.formatter.line_anchordef(self.lineno)
  63 +        else:
  64 +            return ''
  65 +
  66      def format(self, formatter):
  67          """ For each line, scan through looking for magic
  68              strings, outputting verbatim any intervening text.
  69 @@ -951,8 +959,9 @@
  70          # Main loop
  71          for line in self.lines:
  72              self.lineno += 1
  73 -            if self.line_anchors:
  74 -                self.request.write(self.formatter.line_anchordef(self.lineno))
  75 +            self.line_anchor_printed = 0
  76 +            if not self.in_table:
  77 +                self.request.write(self._line_anchordef())
  78              self.table_rowstart = 1
  79              self.line_was_empty = self.line_is_empty
  80              self.line_is_empty = 0
  81 @@ -1026,6 +1035,7 @@
  82                  if not line.strip():
  83                      if self.in_table:
  84                          self.request.write(self.formatter.table(0))
  85 +                        self.request.write(self._line_anchordef())
  86                          self.in_table = 0
  87                      # CHANGE: removed check for not self.list_types
  88                      # p should close on every empty line
  89 @@ -1087,6 +1097,7 @@
  90                      
  91                      # Close table
  92                      self.request.write(self.formatter.table(0))
  93 +                    self.request.write(self._line_anchordef())
  94                      self.in_table = 0
  95                                              
  96              # Scan line, format and write

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2006-02-17 16:48:25, 3.6 KB) [[attachment:moin-html401.txt]]
  • [get | view] (2006-02-17 17:07:01, 61.9 KB) [[attachment:validator_output_1.html]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.