From b14e7a6af18b251499d9c769986b69eb456059c4 Mon Sep 17 00:00:00 2001 From: rich Date: Thu, 30 Sep 2004 14:58:14 +0000 Subject: [PATCH] Allow
for linebreaks. --- scripts/wikilib.ml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/wikilib.ml b/scripts/wikilib.ml index 081385f..b366ae2 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.7 2004/09/25 16:05:03 rich Exp $ + * $Id: wikilib.ml,v 1.8 2004/09/30 14:58:14 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 @@ -91,7 +91,7 @@ let obscure_mailto url = (* This matches any markup. *) let markup_re = let link = "\\[\\[\\s*(?:.+?)\\s*(?:\\|.+?\\s*)?\\]\\]" in - let tag = "" in + let tag = "" in Pcre.regexp ("(.*?)((?:" ^ link ^ ")|(?:" ^ tag ^ "))(.*)") (* This matches links only, and should be compatible with the link contained @@ -321,6 +321,9 @@ let _markup_paragraph dbh hostid text = | FoundOpen (first, elem, rest) when elem = "nowiki" -> (* handle specially ... *) escape_html first :: loop (rest, elem :: []) + | FoundOpen (first, elem, rest) when elem = "br" -> + (* handle
specially ... *) + escape_html first :: "
" :: loop (rest, []) | FoundOpen (first, elem, rest) -> (* open tag - push it onto the stack *) escape_html first :: "<" :: elem :: ">" :: loop (rest, [elem]) @@ -344,6 +347,9 @@ let _markup_paragraph dbh hostid text = | FoundOpen (first, elem, rest) when elem = "nowiki" -> (* handle specially ... *) escape_html first :: loop (rest, elem :: stack) + | FoundOpen (first, elem, rest) when elem = "br" -> + (* handle
specially ... *) + escape_html first :: "
" :: loop (rest, stack) | FoundOpen (first, elem, rest) -> (* open tag - push it onto the stack *) escape_html first :: "<" :: elem :: ">" :: -- 1.8.3.1