Quantcast
Channel: Indentation of tabs and spaces is inconsistent in Stack Snippets - Meta Stack Overflow
Viewing all articles
Browse latest Browse all 2

Indentation of tabs and spaces is inconsistent in Stack Snippets

$
0
0

When I write code using JS/HTML snippet editor (orange icon):

and paste code which contains one or more tab () characters as line indentation, then the snippet editor shows me this:

The same code in the answer "preview" looks like this:

While the same code in the answer editor looks like this:

So, we see three different places where code is viewed have different indentation for the line console.log('b'). This inconsistency often forces the author to put "blind" line indentation fixes into the snippet editor to ensure the code is properly formatted when rendered.

My proposition: let's show code indentation in a consistent way (especially in the snippet editor and answer editor/preview)


For reproducibility, here is the snippet used for this question:

function f() {  console.log('a'); // I use 2 space to line indentationconsole.log('b'); // I use tab to line indentation}

Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>