Ticket #10278 (closed defect: fixed)

Opened 9 months ago

Last modified 7 months ago

Plugin found to be working on 1.0rc1 - but needs a patch for python2.6

Reported by: sdegrande Assigned to: rjollos
Priority: normal Component: MarkdownMacro
Severity: normal Keywords: compatibility
Cc: Trac Release: 1.0

Description

This plugin works on 1.0, but a patch is needed for python 2.6, as the one proposed in #9157, or the following one:

diff -r ec2c58e517b9 markdownmacro/0.11/Markdown/macro.py
--- a/markdownmacro/0.11/Markdown/macro.py	Sat Aug 11 22:09:49 2012 +0000
+++ b/markdownmacro/0.11/Markdown/macro.py	Wed Sep 05 12:39:28 2012 +0200
@@ -27,7 +27,7 @@
 LINK = compile(
     r'(\]\()([^) ]+)([^)]*\))|(<)([^>]+)(>)|(\n\[[^]]+\]: *)([^ \n]+)(.*\n)'
 )
-HREF = compile(r'href=[\'"]?([^\'" ]*)')
+HREF = compile(r'href=[\'"]?([^\'" ]*)', I)
 
 __all__ = ['MarkdownMacro']
 
@@ -47,8 +47,7 @@
             f.format(target, out)
             url = search(
                     HREF,
-                    out.getvalue(),
-                    I).groups()[0]
+                    out.getvalue()).groups()[0]
             # Trac creates relative links, which Markdown won't touch inside
             # <autolinks> because they look like HTML
             if pre == '<' and url != target:

I do not know python's internals, so I don't know which one is the more efficient. I suppose that such a patch is compatible with other 2.x versions of python, but I was not able to check.

Attachments

Change History

10/01/12 22:32:28 changed by rjollos

  • owner changed from dwclifton to rjollos.
  • cc deleted.
  • type changed from task to defect.

10/01/12 22:40:21 changed by rjollos

(In [12084]) Refs #10278: Renamed 0.11 directory to trunk.

10/01/12 23:17:42 changed by rjollos

sdegrande: thank you for yet another patch. Please test the latest trunk and report back if you can. If there are any other open tickets for unmaintained plugins with patches from you, please CC me on them and I'll get the patches applied.

(follow-up: ↓ 6 ) 10/01/12 23:18:02 changed by rjollos

  • status changed from new to closed.
  • resolution set to fixed.

(In [12085]) Fixes #9157, #10278: (0.11.2)

  • FIX: Allowed syntax for compiling a regular expression has changed by Python 2.6. Thanks to ringare and sdegrande for the patch.
  • Misc minor refactoring.
  • Updated documentation by copying the wiki page into README.

10/01/12 23:29:46 changed by rjollos

(In [12086]) Refs #9157, #10278: Updated documentation now that macro is hosted in t-h.o.

(in reply to: ↑ 4 ) 11/02/12 14:41:25 changed by sdegrande

Replying to rjollos:

(In [12085]) Fixes #9157, #10278: (0.11.2) * FIX: Allowed syntax for compiling a regular expression has changed by Python 2.6. Thanks to ringare and sdegrande for the patch. * Misc minor refactoring. * Updated documentation by copying the wiki page into README.

Works well. Thanks for your work.


Add/Change #10278 (Plugin found to be working on 1.0rc1 - but needs a patch for python2.6)




Change Properties
Action