#!/bin/sh
# aerc-md-convert — multipart-converter for aerc ([multipart-converters] text/html)
# Reads the draft (markdown) on stdin, writes the HTML part to stdout.
# Minimal clean HTML: no pandoc boilerplate, small readable CSS inline.
{
  printf '%s\n' '<html><head><meta charset="utf-8"><style>body{font-family:sans-serif;font-size:14px;line-height:1.5;max-width:60em}pre,code{font-family:monospace;font-size:13px;background:#f4f4f4;padding:1px 4px;border-radius:3px}pre{padding:8px;overflow-x:auto}img{max-width:100%}blockquote{border-left:3px solid #ccc;margin-left:0;padding-left:1em;color:#555}table{border-collapse:collapse}td,th{border:1px solid #ccc;padding:4px 8px}</style></head><body>'
  pandoc -f markdown -t html5
  printf '%s\n' '</body></html>'
}