mdocml: sync a few upstream commits