[feature] Custom DocTypes fixes #649