X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=scripts%2Fwikilib.ml;h=f4b309bafbd68be58c7faa27e4536e8b5d917ba4;hb=22c5eb291c13270f17f2cee76b760634f230347e;hp=9651aadd39dde19d2d95a99dd1808595966c0046;hpb=6eacefcb7258db7b56fe796af84961cafac90eac;p=cocanwiki.git diff --git a/scripts/wikilib.ml b/scripts/wikilib.ml index 9651aad..f4b309b 100644 --- a/scripts/wikilib.ml +++ b/scripts/wikilib.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * Copyright (C) 2004 Merjis Ltd. - * $Id: wikilib.ml,v 1.12 2004/10/11 14:13:04 rich Exp $ + * $Id: wikilib.ml,v 1.13 2004/10/14 15:57:15 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 @@ -218,9 +218,11 @@ let markup_link dbh hostid link = let url, clasz, title = if Pcre.pmatch ~rex:url_re url then escape_html_tag url, "external", url (* http://.... *) - else if Pcre.pmatch ~rex:mailto_re url then ( + else if Pcre.pmatch ~rex:mailto_re url then obscure_mailto url, "mailto", url - ) else ( + else if String.length url >= 1 && url.[0] = '/' then (* /index etc. *) + escape_html_tag url, "internal", url + else ( let title = url in (* Look up the 'URL' against the titles in the database and * obtain the real URL. @@ -437,7 +439,7 @@ let allowed_elements = "br", []; ] in let headers = [ "h3", []; "h4", []; "h5", []; "h6", [] ] in - let links = [ "a", ["href"] ] in + let links = [ "a", ["href"; "name"] ] in let images = [ "img", ["src"; "alt"; "width"; "height"; "longdesc"] ] in let forms = [