summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKenneth Albanowski <kjahds@kjahds.com>1996-12-20 16:43:35 -0500
committerChip Salzenberg <chip@atlantic.net>1996-12-23 12:58:58 +1200
commit8c634b6ed8dff69ce029df1386a301fb7f8b3062 (patch)
treef78bd37eff687c1aca335c94dd30bd5623927bdc /lib
parentb4730b2b81770bcc392cf36505f77d68a1f5e9f7 (diff)
downloadperl-8c634b6ed8dff69ce029df1386a301fb7f8b3062.tar.gz
Better support for =for
private-msgid: <Pine.LNX.3.93.961220163747.298T-100000@kjahds.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Pod/Text.pm26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/Pod/Text.pm b/lib/Pod/Text.pm
index c43172854a..9d6636a82f 100644
--- a/lib/Pod/Text.pm
+++ b/lib/Pod/Text.pm
@@ -86,6 +86,7 @@ $cutting = 1;
$DEF_INDENT = 4;
$indent = $DEF_INDENT;
$needspace = 0;
+$begun = "";
open(IN, $file) || die "Couldn't open $file: $!";
@@ -94,6 +95,15 @@ POD_DIRECTIVE: while (<IN>) {
next unless /^=/;
$cutting = 0;
}
+ if ($begun) {
+ if (/^=end\s+$begun/) {
+ $begun = "";
+ }
+ elsif ($begun eq "text") {
+ print STDOUT $_;
+ }
+ next;
+ }
1 while s{^(.*?)(\t+)(.*)$}{
$1
. (' ' x (length($2) * 8 - length($1) % 8))
@@ -106,6 +116,22 @@ POD_DIRECTIVE: while (<IN>) {
next;
}
+ if (/^=for\s+(\S+)\s*/s) {
+ if ($1 eq "text") {
+ print STDOUT $',"";
+ } else {
+ # ignore unknown for
+ }
+ next;
+ }
+ elsif (/^=begin\s+(\S+)\s*/s) {
+ $begun = $1;
+ if ($1 eq "text") {
+ print STDOUT $'."";
+ }
+ next;
+ }
+
sub prepare_for_output {
s/\s*$/\n/;