Despite being wrong the code appears to work well enough. See issue in https://github.com/enkisoftware/imgui_markdown/pull/28