github edit link
[mdref/mdref] / index.js
index 45b5bb87f507905a029b95416381fcac4bc3f1fd..feaf66e439f9a8286f859980bdc553544ae6f2cb 100644 (file)
--- a/index.js
+++ b/index.js
@@ -31,6 +31,7 @@ function type(s, nn) {
        case "int":
        case "float":
        case "string":
+       case "resource":
        case "array":
        case "object":
        case "callable":
@@ -83,11 +84,11 @@ function type(s, nn) {
                t = s.substring(i+2);
                if (!is_constant(t) && !is_variable(t)) {
                        // methods
-                       return "<a href=\"/" + s.replace(/::|\\/g, "/") + "\">";
+                       return "<a href=\"" + s.replace(/::|\\/g, "/") + "\">";
                }
        }
-       if (-1 !== (j = s.indexOf("\\"))) {
-               return "<a href=\"/" + s.replace(/\\/g, "/").replace(/::|$/, "#") + "\">";
+       if (-1 !== (j = s.indexOf("\\")) && s.substr(j+1,1) !== "n") {
+               return "<a href=\"" + s.replace(/\\/g, "/").replace(/::|$/, "#") + "\">";
        }
        
        switch (s.toLowerCase()) {