3 # Make some hyphens unbreakable.
4 s{(--\w[-\w]+)}{ $x = $1; $x =~ s/-/\\-/g; $x }eg;
5 s/(?<!\\)-(['"\d*])/\\-$1/g;
6 s
#(['"(= /,])-(?!-)#$1\\-#g;
8 s/(\[\w)-(\w\])/$1\\-$2/g;
9 s{(\\f\(CW.*?\\fP)}{ $x = $1; $x =~ s/(?<!\\)-/\\-/g; $x }eg;
12 # We only need to use "\&'" or "\&." at the start of a line.
13 s/(?<=.)\\\&(['.])/$1$2/g;
15 # Use an em-dash where appropriate.
16 s/ \\?-{1,2} / \\(em /g;
18 # Some quotes turn into open/close quotes.
19 s/'(.)'/\\(oq$1\\(cq/g;
20 s/(^|[ (])"(?!( |$))/$1\\(lq/gm;
21 s/(?<! )"([.,:;! )]|$)/\\(rq$1/gm;
22 s/(\\\(lq[^(]*) "( |$)/$1 \\(rq$2/gm;
23 s/(^| )" ([^(]*\\\(rq)/$1\\(lq $2/gm;
26 s/^([. ])(.*)/ $1 . realquotes($2) /egm;
27 s/(\\f(B|\(CW).*?\\fP)/ realquotes($1) /egs;
29 s/^\\\&(\\\(oq)/$1/gm;
34 $txt =~ s/\\\([lr]q/"/g;
35 $txt =~ s/\\\([oc]q/'/g;