Partial external URL support in Quixe

Occasionally people ask about external hyperlinks in Inform games – that is, a link which fires up a page in an external browser.

This is not part of the Glk/Glulx specs, but interpreters are free to turn URLs in the game output into clickable links.

For a native app, I like the idea of putting “launch URL” into a context menu (right-click or control-click popup menu). For a web app, that’s a nuisance. (I think one could hack it in in some browsers, but not universally.)

Therefore, I’ve added the feature to Quixe in a simpler, but opt-in way. By default, nothing special is done to URLs. But if you add a configuration line to Quixe, external URLs are automatically turned into clickable hyperlinks wherever they occur in the game output.

To give you more control, there are two options available. The “search” option detects all URLs in the output. The “match” option only converts URLs that are a complete line or style span. (This is faster, because it can use a much simpler regex. It also allows you to decide which URLs are linky on a case-by-case basis, by changing when you set the styles.)

For a demo, go to eblong.com/zarf/glk/glkote/sample-demo2.html .

(This code is not yet released. It’s in my github repository, however.)