shortcuts: function()

in xooki.js [717:737]


        shortcuts: function (input) {
            // handle shortcut links like this:
            //    [[svn:build.xml]] => <a href="https://xooki.svn.sourceforge.net/svnroot/xooki/trunk/build.xml">build.xml</a>
            //    [[svn:test/example.js a good example]] => <a href="https://xooki.svn.sourceforge.net/svnroot/xooki/trunk/test/example.js">a good example</a>
            // needs to be configured in xooki config like this
            //      xooki.c.shortcuts.<any shortcut>.url = base url of the shortcut. 
            //      ex: xooki.c.shortcuts.svn.url = https://xooki.svn.sourceforge.net/svnroot/xooki/trunk/
            return input.replace(new RegExp("\\[\\[([^:\n]+):([^\\]\n]+)\\]\\]", "g"), function (str, prefix, code, offset, s) {
            	if (typeof xooki.c.shortcuts == "undefined" || typeof xooki.c.shortcuts[prefix] == "undefined") {
                    xooki.debug('unknown shortcut '+prefix);
            		return str;
            	}
                var index = code.indexOf(' ');
                var path = index>0?code.substring(0,index):code;
                
                var title = index>0?code.substring(index+1):path;
                var pre = typeof xooki.c.shortcuts[prefix].pre == "undefined"?'':xooki.c.shortcuts[prefix].pre;
                var post = typeof xooki.c.shortcuts[prefix].post == "undefined"?'':xooki.c.shortcuts[prefix].post;
                return '<a href="'+pre+path+post+'">'+title+'</a>';
            });
        },