Attachment 'pytidy.patch'

Download

   1 diff -r 67e542fc0f81 MoinMoin/converter/text_html_text_moin_wiki.py
   2 --- a/MoinMoin/converter/text_html_text_moin_wiki.py	Tue Mar 02 21:17:25 2010 +0300
   3 +++ b/MoinMoin/converter/text_html_text_moin_wiki.py	Tue Mar 02 20:36:13 2010 +0100
   4 @@ -17,7 +17,10 @@
   5  from MoinMoin.parser.text_moin_wiki import Parser as WikiParser
   6  interwiki_re = re.compile(WikiParser.interwiki_rule, re.VERBOSE|re.UNICODE)
   7  
   8 -
   9 +try:
  10 +    import tidylib
  11 +except ImportError:
  12 +    tidylib = None
  13  # Portions (C) International Organization for Standardization 1986
  14  # Permission to copy in any form is granted for use with
  15  # conforming SGML systems and applications as defined in
  16 @@ -1435,6 +1438,13 @@
  17      # Due to expat needing explicitly set namespaces, we set these here to allow pasting
  18      # from Word / Excel without issues.
  19      # If you encounter 'ExpatError: unbound prefix', try adding the namespace to the list.
  20 +    if tidylib:
  21 +        text, errors = tidylib.tidy_fragment(text,
  22 +                                             options={'numeric-entities': 1,
  23 +                                             'indent': 0,
  24 +                                             'wrap': 0,
  25 +                                             'output-xhtml': 1})
  26 +
  27      namespace = [u'xmlns:o="urn:schemas-microsoft-com:office:office"',
  28                   u'xmlns:x="urn:schemas-microsoft-com:office:excel"',
  29                   u'xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"',

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] (2008-02-26 15:42:28, 5.2 KB) [[attachment:GraphViz.py]]
  • [get | view] (2009-06-09 11:32:14, 4.7 KB) [[attachment:PageDicts.xapianenabled.py]]
  • [get | view] (2008-04-23 13:09:50, 41.7 KB) [[attachment:Wiki Cheat Sheet V0.1.odg]]
  • [get | view] (2008-04-23 13:09:36, 129.9 KB) [[attachment:Wiki Cheat Sheet V0.1.pdf]]
  • [get | view] (2008-04-23 13:11:00, 36.6 KB) [[attachment:Wiki Cheat Sheet V0.1.png]]
  • [get | view] (2008-04-24 12:55:13, 67.7 KB) [[attachment:Wiki Cheat Sheet V1.0 ENG.odg]]
  • [get | view] (2008-04-24 12:54:59, 165.0 KB) [[attachment:Wiki Cheat Sheet V1.0 ENG.pdf]]
  • [get | view] (2008-04-24 12:57:34, 18.6 KB) [[attachment:Wiki Cheat Sheet V1.0.png]]
  • [get | view] (2010-03-02 19:36:44, 1.4 KB) [[attachment:pytidy.patch]]
 All files | Selected Files: delete move to page copy to page

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