moved from furushchev/markdown-chat