Applied markdown-js fixes from upstream