From 4aaf7f0ffe97b1a4a4317c9970fee0bb9923632c Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sat, 8 Aug 2009 21:30:04 +0200 Subject: Supporess directives and extract tags (not yet used). --- localmarkdown2sms | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) (limited to 'localmarkdown2sms') diff --git a/localmarkdown2sms b/localmarkdown2sms index 704304e..51d3bf9 100755 --- a/localmarkdown2sms +++ b/localmarkdown2sms @@ -33,7 +33,7 @@ use Proc::Fork; #Proc::Daemon::Init; -my (%delay, %reply); +my (%file, %delay, %reply); my ($path) = shift @ARGV; foreach my $file (read_dir( $path )) { @@ -96,20 +96,28 @@ foreach my $file (read_dir( $path )) { $skipcontent = 1; } # reply - } elsif ( defined( $key ) and not ($skipcontent)) { - $content = $reply{$key}[$i] if (defined($reply{$key}[$i])); - $content .= $line . "\n"; - $content =~ s/^\h*$//g; # clean virtually empty lines - $content =~ s/(\S)\h$/$1/g; # strip single trailing space - $content =~ s/\n\n+/\n\n/g; # strip excess newlines - $content =~ s/(\S)\n([^\n])/$1 $2/g; # convert newline to space - $content =~ s/\h*$//g; # strip all trailing spaces - $reply{$key}[$i] = $content; - } elsif ($skipkey or $skipcontent) { - # skipping - already warned about it... } else { - print STDERR "skipping non-key'ed content \"$line\" in file \"$file\"\n" unless ($warn_nonkey_content); - $warn_nonkey_content = 1; + $content = $line . "\n"; + # ikiwiki directives - strip from content and parse for tags + $content =~ s/(?