Changes between Version 2 and Version 3 of MediaWikiPluginMacro


Ignore:
Timestamp:
Apr 25, 2008, 9:15:46 AM (16 years ago)
Author:
bittermann@…
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MediaWikiPluginMacro

    v2 v3  
    1616
    1717Download the zipped source from [download:mediawikipluginmacro here].
     18
     19== Installation ==
     20
     21{{{
     22unzip mediawikipluginmacro.zip
     23cd mediawikipluginmacro
     24### next step (patch) only for pythen 2.3
     25patch <<EOP
     26diff -ruNb mediawiki.orig/parser.py mediawiki/parser.py
     27--- mediawiki.orig/parser.py    2007-07-13 15:17:50.000000000 +0200
     28+++ mediawiki/parser.py 2008-04-25 11:00:59.000000000 +0200
     29@@ -5,7 +5,7 @@
     30 """
     31 
     32 import re, random, math, locale
     33-from base64 import b64encode, b64decode
     34+from base64 import decodestring
     35 from trac.core import *
     36 from trac.wiki.api import IWikiMacroProvider
     37 
     38@@ -920,7 +920,10 @@
     39 
     40 def slugify(text):
     41         """docstring for slugify"""
     42-        return u'/'.join(slugifyBit(t) for t in text.split(u'/'))
     43+        temp = []
     44+        for t in text.split( u'/' ):
     45+            temp.append( slugifyBit( t ) )
     46+        return u'/'.join( temp )
     47 
     48 _linkPat = re.compile(ur'^([A-Za-z0-9\s]+:)?([A-Za-z0-9_\.\-\s\/]+)(?:\|([^\n]+?))?\]\](.*)$', re.UNICODE | re.DOTALL)
     49 def replaceInternalLinks(text):
     50@@ -1329,8 +1332,8 @@
     51                 m = _templateSectionPat.search(headline)
     52                 if m:
     53                         istemplate = True
     54-                        templatetitle = b64decode(m[0])
     55-                        templatesection = 1 + int(b64decode(m[1]))
     56+                        templatetitle = decodestring(m[0])
     57+                        templatesection = 1 + int(decodestring(m[1]))
     58                         headline = _templateSectionPat.sub(u'', headline)
     59                 
     60                 if toclevel:
     61EOP
     62python setup.py install
     63}}}
    1864
    1965== Source ==