mkhtml2: avoid double dict lookups