← Back to team overview

zim-wiki team mailing list archive

Re: ms-outlook uri support


As far as I know, the outlook URLs cannot have a double-slash following the
colon.  I'm pretty sure that is an Outlook implementation detail and not
related to my particular link-generation program or the required registry
settings.  If such is the case, then paste re-writer simply would not work.
 (In my first experiments, I added the double-slashes, in which case it
correctly recognized it as a URL and opened outlook, but outlook gave me an

What do you think about this option:

Outlook URLs are entered with the double-slash (ie. outlook://GUID_HERE),
but when clicked, they are re-written to omit the double slashes?


On Fri, Dec 2, 2011 at 2:06 AM, Jaap Karssenberg <jaap.karssenberg@xxxxxxxxx
> wrote:

> On Thu, Dec 1, 2011 at 7:46 PM, Greg Warner <gdwarner@xxxxxxxxx> wrote:
>> Here is the code you are referring to (contained within a function called
>> open_url()):
>>     elif url.startswith('outlook:') and hasattr(os, 'startfile'):
>>       # Special case for outlook folder paths on windows
>>       os.startfile(url)
>> First thing I notice is that it's looking for "outlook" and not "Outlook"
>> (which is what the link generator program uses... no biggie).
> That is fixed easily by making the check case insensitive. Probably should
> match all URL schemes case insensitive now I think about it....
>> The problem is that open_url() is only called if the link-type (as
>> determined by the link_type() function in parsing.py) does not match either
>> interwiki, page, file, or notebook (see pageview.py:4547).  Without the
>> modifications I made, the link-type is determined to be a page as it does
>> not match the url regex, and therefore, the open_url() function never gets
>> called for an outlook link.
>> Does that make sense?
>> If the outlook links had the double slash after the colon (outlook://),
>> we wouldn't be having this problem as it would match the url regex.  But it
>> does not.
> OK, now I understand. From the submitter of the first patch I understood
> outlook allowed copy pasting links with "outlook://" URL scheme, so all
> worked as expected. But don't know what he used for copy pasting the links.
> One problem I have with matching "outlook:" is that you could never make a
> page called "outlook" anymore. So I would rather implement it in a
> different way.
> One option would be to rewrite outlook URLs when they are pasted. (We can
> distinguish external links from internal links when they are pasted - so
> should be able to rewrite "outlook:" to "outlook://".)
> The other option is to make the match more specific. For example for
> "mailto:"; we also match URI scheme without the "//", but only if the link
> also has a "@" in it and actually looks like an email address. So you can
> still make a page called "mailto" and use it.
> Regards,
> Jaap

Follow ups