sphinx-doc/sphinx

HTML Help external links open in viewer

Closed this issue · 3 comments

Currently when you have an external link then build the text to htmlhelp the chm viewer will open that external link in its own window. This usually goes quite badly since the internal viewer is still running some ancient version of IE, and it's almost certainly not what's wanted.

The workaround for this is to add target="_blank" to external links when building for htmlhelp. I can do this manually on my links by switching them out for raw <a> html links, but is this something that would be feasible for sphinx to do when building for htmlhelp?

I try to fix this, but I don't have a windows environment.
Could you check this branch please? https://github.com/tk0miya/sphinx/tree/2550_external_links_on_htmlhelp

BTW, is it common sense for all htmlhelp users to change external hyperlinks to target=_blank as default behavior of Sphinx?
Any configuration is needed?

Hi there, running from that tree seems to fix the problem perfectly from my testing.

I'm very sorry for the slow reply - I was away from home when you posted this, and I forgot to check when I got back. I only remembered now as I'm making a new release of my software so rebuilding the html help.

I think having all htmlhelp external links open in target=_blank would be a sensible default behaviour, as I would say it's unlikely and unexpected behaviour to have external websites open in the help viewer. It should just be limited to displaying internal pages from the documentation build itself. Likewise, I just tested and it is using internet explorer 7 for me, on Windows 7. Many webpages will not display correctly on such an old version.

Fixed at 5f63aac.
Thank you for reporting and confirmation.