#!/usr/bin/perl
use strict;
use warnings;
use utf8;
my $filename = shift;
my $html = shift;
my $file;
{
local $/;
undef $/;
open G, "<:utf8", $filename or die "Can't open [$filename: $!]";
$file = $1
}m;
# s{\n([. [:upper:]]+)\n}{$1
}g;
s!_([^_]+)_!$1!g;
s!\+([^+]+)\+!$1!g;
s!\^([[:alpha:]]+)!$1!g;
# s!\n\s+\[(\d+)\](.*?)(?=\n\S)!$notes{$1}=$2;""!ges;
s!&!&!g;
s!--!—!g;
s{\n\n}{
}g; } open H, ">:utf8", $html or die "Can't create [$filename: $!]"; select H; print header(); print $file; print footnotes(%notes); print footer(); close H; sub footnotes { my %notes = @_; if (%notes) { my $ret = "