From 6e4d163b84ff4263664a0e7a144df4cbc66fc248 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 28 Jun 2005 14:41:58 +0000 Subject: [PATCH] Replace hyphens with "\-". Although the old-school gnomes who maintain groff apparently don't figure it's necessary to document this anywhere, there is apparently only one reliable way to make a non-breaking hyphen in groff: with "\-". At least that it what testing in my environment seems to indicate. And because groff is not at all smart in the way it breaks things at hyphens (it will, for example, break command arguments across lines if they contain hyphens), we must globally replace all hyphens with "\-". God in heaven, please let me live to see a day when roff and all is (r)offspring have disappeared from the face of the earth. --- xsl/params/man.string.subst.map.xml | 80 +++++++++++++---------------- 1 file changed, 35 insertions(+), 45 deletions(-) diff --git a/xsl/params/man.string.subst.map.xml b/xsl/params/man.string.subst.map.xml index a035576b2..d73dfa070 100644 --- a/xsl/params/man.string.subst.map.xml +++ b/xsl/params/man.string.subst.map.xml @@ -12,11 +12,28 @@ + + - + + + + + + + + + + + + + + + + @@ -42,10 +59,9 @@ before applying the roff character map. causes target strings to be replaced in roff requests and escapes, not just in the visible contents. - In particular, do not attempt to add mappings for the - dot/period character or hyphen/minus character - (-/-). Doing so will break your output. For an - explanation, see . + In particular, do not attempt to add a mapping for the + dot/period character. Doing so will break your output. For an + explanation, see . @@ -68,46 +84,20 @@ each of which has two attributes: - - About adding backslashes before dots and hyphens - The stylesheets do not add backslashes before periods/dots or - hyphens (-). One reason is that, because string substitution - is performed over the entire roff source of each man page, it would - be complicated to replace dots and hyphens in visible contents - without also causing them to be replaced in roff requests and - escapes; for example, without causing, say, the - .TH roff macro to be replaced with - \.TH. Additionally: - - - - - Backslashes in front of periods/dots are needed only in - the very rare case where a period is the very first character in - a line, without any space in front of it. A better way to deal - with that rare case is to add a zero-width space in front of the - offending dot(s) in your source - - - Backslashes in front of -/- are - needed... when? Myself, I don't know, so the current - stylesheets do not add backslashes in front of them, ever. If - there is a specific case where they are necessary or desirable, - then we need to add code for that case, not just do a blanket - conversion. - And, anyway, my understanding from reading the groff docs - is that \- is, specifically, a - minus sign. So if you have places where you - want a minus sign to be output instead of -, then use - −/− in your source instead. And if you have - places where you want an en dash, –/–. Or - if there are places where the stylesheets are internally - generating - where they should be generating − - or –, then we need to fix those, not just do blanket - conversion. - - - + + About adding backslashes before dots + The stylesheets do not add backslashes before + periods/dots. One reason is that, because string substitution is + performed over the entire roff source of each man page, it would be + complicated to replace dots in visible contents without also causing + them to be replaced in roff requests and escapes; for example, + without causing, say, the .TH roff macro to be + replaced with \.TH. Additionally, backslashes in + front of periods/dots are needed only in the very rare case where a + period is the very first character in a line, without any space in + front of it. A better way to deal with that rare case is to add a + zero-width space in front of the offending dot(s) in your + source. -- 2.40.0