Skip to main content
edited tags
Link
terdon Mod
  • 252.2k
  • 3
  • 87
  • 143
Became Hot Meta Post
Source Link
ibuprofen
  • 3.1k
  • 9
  • 4

TAB not preserved in code blocks

Mangling code or tab separated data:

This    is  tab delimited   data

Rendering of code blocks break tabs.

This is bad for example

  • for code that require tabs (Example).
  • for posts where users paste tab delimited data.
  • and in general ... rude :P

When respondents copy the data or code from a question they get spaces instead of tabs, even if questioner has used tabs. If one click edit the tabs are present, but not in the HTML rendering. Code snippets also get a four space indentation where tab is used.

Should tabs be preserved or at least be an opt out?

CSS has tab-size which can be used as a optional configuration for those who want 1 or 32 spaces per tab or what ever :P

https://caniuse.com/?search=tab-size