summaryrefslogtreecommitdiff
path: root/doc/scripts
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2016-09-22 14:49:57 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2016-09-22 14:50:02 +0200
commit8f4dcf8efe02096a782f24e202d5faed60ec94ce (patch)
tree181f72480f099d6007040a4a004db4c475adfd8f /doc/scripts
parent662af4d6e448d0b9bf4ff6d166343f5972d60685 (diff)
downloadgnutls-8f4dcf8efe02096a782f24e202d5faed60ec94ce.tar.gz
gdoc: improved the detection and display of escaped characters (@%)
This allows to properly display strings like %COMPAT and @SYSTEM in the manual and the manpages.
Diffstat (limited to 'doc/scripts')
-rwxr-xr-xdoc/scripts/gdoc18
1 files changed, 13 insertions, 5 deletions
diff --git a/doc/scripts/gdoc b/doc/scripts/gdoc
index ceaa214427..5d2d609699 100755
--- a/doc/scripts/gdoc
+++ b/doc/scripts/gdoc
@@ -134,9 +134,9 @@
use POSIX qw(strftime);
# match expressions used to find embedded type information
-$type_constant = "\\\%([A-Za-z0-9_]+)";
+$type_constant = '(?<!\%)\%([A-Za-z0-9_]+)';
$type_func = "([A-Za-z0-9_]+\\(\\))";
-$type_param = '\@([A-Za-z0-9_]+)\s*';
+$type_param = '(?<!\@)\@([A-Za-z0-9_]+)\s*';
$type_struct = "\\\#([A-Za-z0-9_]+)";
$type_env = "(\\\$[A-Za-z0-9_]+)";
@@ -148,13 +148,16 @@ $type_env = "(\\\$[A-Za-z0-9_]+)";
@highlights_html = ( [$type_constant, '"<i>$1</i>"'],
[$type_func, '"<b>$1</b>"'],
[$type_struct, '"<i>$1</i>"'],
- [$type_param, '" <tt><b>$1</b></tt> "'] );
+ [$type_param, '" <tt><b>$1</b></tt> "'],
+ ['\%\%', '"\%"']
+ );
$blankline_html = "<p>";
@highlights_texinfo = ( [$type_param, '" \@code{$1} "'],
[$type_constant, '"\@code{$1} "'],
[$type_func, '"\@code{$1} "'],
[$type_struct, '"\@code{$1} "'],
+ ['\%\%', '"\%"'],
);
$blankline_texinfo = "";
@@ -162,6 +165,7 @@ $blankline_texinfo = "";
[$type_constant, '"{\\\it $1}"'],
[$type_func, '"{\\\bf $1}"'],
[$type_struct, '"{\\\it $1}"'],
+ ['\@\@', '"\@"']
);
$blankline_tex = "\\\\";
@@ -177,14 +181,18 @@ $blankline_sgml = "</para><para>\n";
@highlights_man = ( [$type_constant, '"\\\fB$1\\\fP"'],
[$type_func, '"\\\fB$1\\\fP"'],
[$type_struct, '"\\\fB$1\\\fP"'],
- [$type_param, '" \\\fI$1\\\fP "'] );
+ [$type_param, '" \\\fI$1\\\fP "'],
+ ['\%\%', '"\%"'],
+ ['\@\@', '"\@"']);
$blankline_man = "";
# text-mode
@highlights_text = ( [$type_constant, '"$1"'],
[$type_func, '"$1"'],
[$type_struct, '"$1"'],
- [$type_param, '"$1 "'] );
+ [$type_param, '"$1 "'],
+ ['\%\%', '"\%"'],
+ ['\@\@', '"\@"']);
$blankline_text = "";
my $lineprefix = "";