emgithub icon indicating copy to clipboard operation
emgithub copied to clipboard

Strip unnecesarry indentation from code snippets

Open mjmacleod opened this issue 3 years ago • 0 comments

When code snippets are linked that are inside a function (or maybe even a few blocks of logic) we get output like: <space><space><space><space>foo =8; instead of: foo =8;

Which leads to ugly snippets that show a scrollbar when its not necessary etc. etc. Instead we should just figure out the indentation level of the code from the first line and then strip that much indentation from any subsequent lines.

mjmacleod avatar Aug 25 '22 15:08 mjmacleod