fix: create output directories if specified ones do not exist; escape the single quote character for href attribute