summaryrefslogtreecommitdiffstats
path: root/contrib/groff/tmac/strip.sed
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/groff/tmac/strip.sed')
-rw-r--r--contrib/groff/tmac/strip.sed10
1 files changed, 9 insertions, 1 deletions
diff --git a/contrib/groff/tmac/strip.sed b/contrib/groff/tmac/strip.sed
index 05c9633..5823967 100644
--- a/contrib/groff/tmac/strip.sed
+++ b/contrib/groff/tmac/strip.sed
@@ -1,3 +1,11 @@
# $FreeBSD$
-/%beginstrip%/,$s/[ ]*\\".*//
+# strip comments, spaces, etc. after a line containing `%beginstrip%'
+/%beginstrip%/,$ {
+ s/^\.[ ]*/./
+ s/^\.\\".*/./
+ s/\\".*/\\"/
+ /\(.[ad]s\)/!s/[ ]*\\"//
+ /\(.[ad]s\)/s/\([^ ]*\)\\"/\1/
+ s/\([^/]\)doc-/\1/g
+}
/^\.$/d
OpenPOWER on IntegriCloud