Script for rebuilding the links table from scratch.
[cocanwiki.git] / scripts / wikilib.ml
index 251311e..081385f 100644 (file)
@@ -1,7 +1,7 @@
 (* COCANWIKI - a wiki written in Objective CAML.
  * Written by Richard W.M. Jones <rich@merjis.com>.
  * Copyright (C) 2004 Merjis Ltd.
- * $Id: wikilib.ml,v 1.5 2004/09/16 18:06:31 rich Exp $
+ * $Id: wikilib.ml,v 1.7 2004/09/25 16:05:03 rich Exp $
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -42,8 +42,9 @@ let nontrivial_re = Pcre.regexp ~flags:[`CASELESS] "[a-z0-9]"
 
 let generate_url_of_title (dbh : Dbi.connection) hostid title =
   (* Create a suitable URL from this title. *)
-  let url = String.map (function '\000' .. ' ' | '<' | '>' | '&' | '"' -> '_'
-                         | c -> Char.lowercase c) title in
+  let url =
+    String.map (function '\000' .. ' ' | '<' | '>' | '&' | '"' | '+' -> '_'
+                 | c -> Char.lowercase c) title in
 
   (* Check URL is not too trivial. *)
   if not (Pcre.pmatch ~rex:nontrivial_re url) then
@@ -413,6 +414,7 @@ let allowed_elements =
   let forms = [
     "form", [ "method"; "action"; "enctype" ];
     "input", [ "name"; "value"; "type"; "size"; "maxlength" ];
+    "textarea", [ "name"; "rows"; "cols" ];
   ] in
 
   let tables = [