format-intf modifie' pour echapper les [ et ]

git-svn-id: http://caml.inria.fr/svn/ocamldoc/trunk@9765 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Pierre Weis 1997-12-02 17:17:32 +00:00
parent 18be0988c6
commit 5d7722c983
1 changed files with 3 additions and 1 deletions

View File

@ -69,13 +69,15 @@ while(<>) {
}
s/^\s*//;
$count = 0;
foreach $part (split(/([\[\]])/, $_)) {
foreach $part (split(/(\\?[\[\]])/, $_)) {
if ($part eq "[") {
print ($count == 0 ? "\\verb`" : "[");
$count++;
} elsif ($part eq "]") {
$count--;
print ($count == 0 ? "`" : "]");
} elsif ($part =~ m/^\\([\[\]])$/) {
print $1;
} else {
print $part;
}