aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2023-11-02 05:24:53 +0000
committerNIIBE Yutaka <[email protected]>2023-11-02 05:24:53 +0000
commit82a8e2cece08fa0ca6aff9bdf62414731d384083 (patch)
treed871ee1ca6f0643791b0be38034940471b1a068f
parentdoc: Minor style fix. (diff)
downloadlibgpg-error-82a8e2cece08fa0ca6aff9bdf62414731d384083.tar.gz
libgpg-error-82a8e2cece08fa0ca6aff9bdf62414731d384083.zip
yat2m: Support Texinfo input -- and ---.
* doc/yat2m.c (proc_texi_buffer): Handle en-dash and em-dash. -- GnuPG-bug-id: 6746 Signed-off-by: NIIBE Yutaka <[email protected]>
-rw-r--r--doc/yat2m.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/yat2m.c b/doc/yat2m.c
index f1bfbe5..ebddba8 100644
--- a/doc/yat2m.c
+++ b/doc/yat2m.c
@@ -1627,6 +1627,24 @@ proc_texi_buffer (FILE *fp, const char *line, size_t len,
}
else if (*s == '\\')
writestr ("\\\\", "\\\\", fp);
+ else if (sect && *s == '-')
+ /* Handle -- and --- when it's _not_ in an argument. */
+ {
+ if (len < 2 || s[1] != '-')
+ writechr (*s, fp);
+ else if (len < 3 || s[2] != '-')
+ {
+ writestr ("\\[en]", "&ndash;", fp);
+ len--;
+ s++;
+ }
+ else
+ {
+ writestr ("\\[em]", "&mdash;", fp);
+ len -= 2;
+ s += 2;
+ }
+ }
else
writechr (*s, fp);
}