improve caching in markdown formatter