Fix piecewise mapping and force markdown mode