0) {
# Some other
inside a quote div.
quotelevel++; next;
} else {
# Some
outside a quote div.
print; next;
}
}
/^<[/]div/ {
if (quotelevel > 0) {
# Some
inside a quote div.
quotelevel--;
if (quotelevel == 0) {
printf "@s{quotedtext}\n", FNR;
printf "\n", FNR;
nclose++;
}
next;
} else {
# Some
outside a quote div.
print;
next;
}
}
(quotelevel > 0) {
# Some other line inside a quote:
next;
}
// {
# Some other line outside a quote:
print;
next;
}
END {
printf "%d open quote %d close quote\n", nopen, nclose > "/dev/stderr";
if (quotelevel > 0) { printf "** not closed!\n" > "/dev/stderr"; exit(1); }
}
function arg_error(msg)
{
printf "%s\n", msg > "/dev/stderr";
printf "usage: %s\n", usage > "/dev/stderr";
abort = 1;
exit 1
}
function prog_error(msg)
{
printf "**PROG ERROR: %s\n", msg > "/dev/stderr";
abort = 1;
exit 1
}
function data_error(msg)
{
printf "%s:%d: %s\n", FILENAME, FNR, msg > "/dev/stderr";
abort = 1;
exit 1
}