Modify

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#10278 closed defect (fixed)

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

Reported by: sdegrande Owned by: 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:

  • markdownmacro/0.11/Markdown/macro.py

    diff -r ec2c58e517b9 markdownmacro/0.11/Markdown/macro.py
    a b  
    2727LINK = compile( 
    2828    r'(\]\()([^) ]+)([^)]*\))|(<)([^>]+)(>)|(\n\[[^]]+\]: *)([^ \n]+)(.*\n)' 
    2929) 
    30 HREF = compile(r'href=[\'"]?([^\'" ]*)') 
     30HREF = compile(r'href=[\'"]?([^\'" ]*)', I) 
    3131 
    3232__all__ = ['MarkdownMacro'] 
    3333 
     
    4747            f.format(target, out) 
    4848            url = search( 
    4949                    HREF, 
    50                     out.getvalue(), 
    51                     I).groups()[0] 
     50                    out.getvalue()).groups()[0] 
    5251            # Trac creates relative links, which Markdown won't touch inside 
    5352            # <autolinks> because they look like HTML 
    5453            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 (0)

Change History (6)

comment:1 Changed 2 years ago by rjollos

  • Cc rjollos removed
  • Owner changed from dwclifton to rjollos
  • Type changed from task to defect

comment:2 Changed 2 years ago by rjollos

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

comment:3 Changed 2 years ago 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.

comment:4 follow-up: Changed 2 years ago by rjollos

  • Resolution set to fixed
  • Status changed from new to closed

(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.

comment:5 Changed 2 years ago by rjollos

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

comment:6 in reply to: ↑ 4 Changed 2 years ago 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 Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.