Created
July 23, 2015 15:19
-
-
Save kinichiro/ec1e7dea649c600e5dd5 to your computer and use it in GitHub Desktop.
find invalid lists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
foreach $in ( @ARGV ) { | |
next if( $in !~ /.+.adoc/ ) ; | |
printf "\n:-| processing [$in] ...\n"; | |
open(IN, "<$in") || die "cant open file\n"; | |
$line = 0; | |
$flag = 0; | |
while( <IN> ) { | |
++ $line; | |
chop; | |
if($_ =~ /^\* .*/) { | |
$flag = 1; | |
} elsif ($_ eq "" || $_ eq "+") { | |
$flag = 0; | |
} elsif ($flag == 1 && $_ !~ /^ /) { | |
printf "%4d : [%s]\n", $line, $_; | |
$flag = 0; | |
} else { | |
$flag = 0; | |
} | |
} | |
close(IN) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment