markdown implementation does not recognizes https

Bug #193622 reported by Tzury Bar Yochay
2
Affects Status Importance Assigned to Milestone
Infogami
New
Undecided
Unassigned
Revision history for this message
Anand Chitipothu (anandology) wrote : Re: [Bug 193622] [NEW] markdown implementation does not recognizes https

On Feb 20, 2008 2:58 PM, Tzury Bar Yochay <email address hidden> wrote:
> Public bug reported:
>
> the link:
> <https://www.resiprocate.org/files/pub/reSIProcate/releases/resiprocate-1.2.3.tar.gz> is ignored
> while
> <http://www.resiprocate.org/files/pub/reSIProcate/releases/resiprocate-1.2.3.tar.gz> works
>
> you can see it online at: http://crosscompile.org/reSIProcate
>
> in the section starts with: You can download reSIProcate either from:
> https://www.resiprocate.org/files/pub/reSIProcate/releases/resiprocate-1.2.3.tar.gz.

Looks like it is a bug in markdown.
Can you check, if this bug has been fixed in the latest version of markdown?

Here is the workaround.

Add the following to _register_mdx_extensions function in infogami/utils/view.py

    index = md.inlinePatterns.index(markdown.AUTOLINK_PATTERN)
    md.inlinePatterns.insert(index,
markdown.AutolinkPattern(markdown.AUTOLINK_RE.replace('http',
'https')))
    md.inlinePatterns.insert(index,
markdown.AutolinkPattern(markdown.AUTOLINK_RE.replace('http', 'ftp')))

Revision history for this message
Tzury Bar Yochay (tzury-by) wrote :

 | Looks like it is a bug in markdown.
that is right
 | Can you check, if this bug has been fixed in the latest version of markdown?
No. It is still there

see the following:
>>> import markdown
>>> markdown.version
'1.7'
>>> markdown.markdown('<http://www.google.com>')
u'<p><a href="http://www.google.com">http://www.google.com</a>\n</p>'
>>> markdown.markdown('<https://www.google.com>')
u'<https://www.google.com>'
>>>

I think I will use the offered workaround.

BTW:
A) at jottit.com it works fine.
Aaron, did you guys used this same workaround?

B) I filed a bug out there (http://sourceforge.net/tracker/index.php?func=detail&aid=1897830&group_id=153041&atid=790198)

Thanks again,
Tzury

Here is the workaround.

Add the following to _register_mdx_extensions function in infogami/utils/view.py

    index = md.inlinePatterns.index(markdown.AUTOLINK_PATTERN)
    md.inlinePatterns.insert(index,
markdown.AutolinkPattern(markdown.AUTOLINK_RE.replace('http',
'https')))
    md.inlinePatterns.insert(index,
markdown.AutolinkPattern(markdown.AUTOLINK_RE.replace('http', 'ftp')))

Revision history for this message
Tzury Bar Yochay (tzury-by) wrote :

@ markdown.py replace this line:
AUTOLINK_RE = r'<(http://[^>]*)>' # <http://www.123.com>
with this one:
AUTOLINK_RE = r'<((?:f|ht)tps?://[^>]*)>' # <http://www.123.com> | <ftp://...> | <https:...>

Revision history for this message
Anand Chitipothu (anandology) wrote : Re: [Bug 193622] Re: markdown implementation does not recognizes https

On Thu, Feb 21, 2008 at 10:08 AM, Tzury Bar Yochay <email address hidden> wrote:
> @ markdown.py replace this line:
> AUTOLINK_RE = r'<(http://[^>]*)>' # <http://www.123.com>
> with this one:
> AUTOLINK_RE = r'<((?:f|ht)tps?://[^>]*)>' # <http://www.123.com> | <ftp://...> | <https:...>

I wouldn't suggest doing that. It becomes very difficult to manage if
we patch other modules.
I am planning to add the workaround that I suggested to infogami.

Revision history for this message
Tzury Bar Yochay (tzury-by) wrote :

As I was told (by mail) this is what they did at markdown.py and it will be
available at next revision

On Thu, Feb 21, 2008 at 7:09 AM, Anand Chitipothu <email address hidden>
wrote:

> On Thu, Feb 21, 2008 at 10:08 AM, Tzury Bar Yochay <email address hidden>
> wrote:
> > @ markdown.py replace this line:
> > AUTOLINK_RE = r'<(http://[^>]*)>' # <http://www.123.com>
> > with this one:
> > AUTOLINK_RE = r'<((?:f|ht)tps?://[^>]*)>' # <http://www.123.com>
> | <ftp://...> | <https:...>
>
> I wouldn't suggest doing that. It becomes very difficult to manage if
> we patch other modules.
> I am planning to add the workaround that I suggested to infogami.
>
> --
> markdown implementation does not recognizes https
> https://bugs.launchpad.net/bugs/193622
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
Tzury Bar Yochay (tzury-by) wrote :

As I was told (by mail) this is what they did at markdown.py and it will be available at next revision

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.