Opened 11 years ago

Last modified 4 years ago

#10958 new defect

Exception while processing email links without EMAIL_VIEW privilege — at Version 2

Reported by: marmarek@… Owned by: Ryan J Ollos
Priority: high Component: MarkdownMacro
Severity: normal Keywords:
Cc: Trac Release:

Description (last modified by Ryan J Ollos)

When markdown content contains email links like this:

[test](mailto:email@example.com)

and viewer doesn't have EMAIL_VIEW permission, it end up with exception (AttributeError: 'NoneType' object has no attribute 'group').

Trac converts such links (Formatter called from Markdown/macro.py) to:

<p>email@…
</p>

which doesn't match to HREF regexp. This causes exception on line 48 in Markdown/macro.py:

url = re.search(HREF, out.getvalue()).groups()[0]

MarkdownMacro 0.11.2

Attached some workaround patch.

Change History (3)

Changed 11 years ago by marmarek@…

Attachment: markdown-email.patch added

workaround patch

comment:1 Changed 11 years ago by Ryan J Ollos

Owner: changed from Douglas Clifton to Ryan J Ollos
Priority: normalhigh
Status: newassigned

Thanks for the patch.

comment:2 Changed 11 years ago by Ryan J Ollos

Description: modified (diff)
Note: See TracTickets for help on using tickets.