Modify

Opened 12 years ago

Closed 12 years ago

Last modified 12 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: Ryan J Ollos
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 12 years ago by Ryan J Ollos

Cc: anonymous added; Ryan J Ollos removed
Owner: changed from Douglas Clifton to Ryan J Ollos
Type: taskdefect

comment:2 Changed 12 years ago by Ryan J Ollos

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

comment:3 Changed 12 years ago by Ryan J Ollos

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 Changed 12 years ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

(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 12 years ago by Ryan J Ollos

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

comment:6 in reply to:  4 Changed 12 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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.