Notes about Markdown issues and solutions
Summary Markdown Code Blocks: Horizontal Scroll Issue on GitHub The Problem: Code blocks in Markdown don't wrap text—they preserve exact formatting, which is essential for executable code. However, on GitHub's responsive design, long lines in code blocks force horizontal scrolling even on desktop. On mobile, this severely impacts readability. Note that for this case, VSCode Markdown preview may wrap the text and not show horizontal scrollbar. The Issue with Using Code Blocks for Everything: A common mistake is using code blocks for all code-like content, including example output, markup demonstrations, and non-executable examples. While code blocks provide syntax highlighting, they sacrifice user experience on narrower viewports or even wide viewports if the content has long lines exceeding viewport width. The Solution: Choose Based on Semantic Intent Use code blocks when: Displaying executable code that requires exact formatting and indentation Syntax highlighting improves ...