[api] Fix for a bug in markdown preprocessing