git.annexia.org
/
cocanwiki.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Asynchronous updates.
[cocanwiki.git]
/
scripts
/
preview.ml
diff --git
a/scripts/preview.ml
b/scripts/preview.ml
index
6fd0a2b
..
df0da8d
100644
(file)
--- a/
scripts/preview.ml
+++ b/
scripts/preview.ml
@@
-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.
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: preview.ml,v 1.
5 2004/10/04 15:19:56
rich Exp $
+ * $Id: preview.ml,v 1.
7 2004/12/20 11:57:28
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
*
* 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
@@
-29,12
+29,18
@@
open Printf
open Cocanwiki
open Cocanwiki
+(* This script is called very frequently indeed during editing. It should
+ * therefore be as short and fast as possible. There is a case for
+ * special-casing the register_script code to avoid doing as much
+ * start-up SQL as possible.
+ *)
+
let run r (q : cgi) (dbh : Dbi.connection) hostid _ _ =
let content = q#param "content" in
let xhtml = Wikilib.xhtml_of_content dbh hostid content in
q#header ~content_type:"text/html; charset=utf-8" ();
let run r (q : cgi) (dbh : Dbi.connection) hostid _ _ =
let content = q#param "content" in
let xhtml = Wikilib.xhtml_of_content dbh hostid content in
q#header ~content_type:"text/html; charset=utf-8" ();
- print_string r xhtml
+ ignore (print_string r xhtml)
let () =
register_script ~restrict:[CanView] run
let () =
register_script ~restrict:[CanView] run