static generator
[mdref/mdref] / public / index.js
index 1d65af4382ccef907a78e6074d5de04e76fd254f..27e368a93ee728e229609384620d310d14213435 100644 (file)
@@ -55,9 +55,11 @@ $(function() {
                        case "ArrayObject":
                        case "ArrayIterator":
                        case "RecursiveArrayIterator":
+                       case "SeekableIterator":
                        case "SplObserver":
                        case "SplSubject":
                        case "SplObjectStorage":
+                       case "JsonSerializable":
                                return "<code>";
 
                        // keywords
@@ -95,8 +97,12 @@ $(function() {
                                        return "<a href=\"" + s.replace(/::|\\/g, "/") + "\">";
                                }
                        }
-                       if (-1 !== (j = s.indexOf("\\")) && s.substr(j+1,1) !== "n") {
-                               return "<a href=\"" + s.replace(/\\/g, "/").replace(/::|$/, "#") + "\">";
+                       if (-1 !== (j = s.lastIndexOf("\\")) && s.substr(j+1,1) !== "n") {
+                               t = s.substring(j+1);
+                               if (!mdref.is_constant(t)) {
+                                       return "<a href=\"" + s.replace(/\\/g, "/").replace(/::|$/, "#") + "\">";
+                               }
+                               return "<a href=\"" + s.substring(0,j).replace(/\\/g, "/") + "#" + t + "\">";
                        }
 
                        switch (s.toLowerCase()) {
@@ -195,7 +201,7 @@ $(function() {
                }
        };
        
-       $("h1,h2,h3,h4,h5,h6,p,li,code").each(mdref.walk);
+       $("h1,h2,h3,h4,h5,h6,p,li,code,td").each(mdref.walk);
        $(window).on("hashchange", mdref.hashchange);
        mdref.hashchange();
 });