Bootstrapping code borrowed from morkdown