#!/bin/sh

# Copyright © 2009-2013 Jakub Wilk <jwilk@jwilk.net>
#
# This file is part of pdfdjvu.
#
# pdf2djvu is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# pdf2djvu is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.

exec sed -e '
/<!--# *\(.*[^ ]\) *#-->/ {
  s//\1/
  b
}
/<!--.*-->/ {
  s///g
  b
}
s/\\\\/\\\\/g
s/"/\\"/g
s/^/"/
s/$/\\n"/
'

# vim:ts=2 sts=2 sw=2 et
