page: capture multiline titles in article contents
[minimedit.git] / article.inc.php
index a39b8971c3546cc236a84fbd63b44571de780064..ea958fadd171a9a87de4e645f5d78d82a8c3a116 100644 (file)
@@ -35,7 +35,7 @@ class ArchiveArticle
                        }
 
                        @list ($this->preface, $this->title, $this->body) =
-                               preg_split('{<h2>(.*?)</h2>\s*}', $this->raw, 2, PREG_SPLIT_DELIM_CAPTURE);
+                               preg_split('{<h2>(.*?)</h2>\s*}s', $this->raw, 2, PREG_SPLIT_DELIM_CAPTURE);
                }
        }
 
@@ -157,9 +157,12 @@ class PageSearch
                                        # ignore symlinks, original contents only
                                        return FALSE;
                                }
+                               if ($current->isDir()) {
+                                       # traverse subdirectories unless untracked in any amount
+                                       return !file_exists("$current/.gitignore");
+                               }
                                # match **/*.html
-                               return $current->isDir()
-                                       || preg_match('/\.html$/', $current->getFilename());
+                               return preg_match('/(?<!\.inc)\.html$/', $current->getFilename());
                        }
                );
        }