Timeline for Change the code block button from inserting indentation to triple-backticks
Current License: CC BY-SA 4.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 21, 2021 at 22:32 | comment | added | Sylvester is on codidact.com | I agree too.⠀⠀⠀ | |
Dec 21, 2021 at 19:46 | comment | added | aheze | For a while my edits consisted mainly of pasting the code into courses.cs.washington.edu/courses/cse142/20su/indent.html, then pasting it back | |
Dec 21, 2021 at 3:48 | comment | added | PM 2Ring | @CaiusJard That's reasonable, for most languages. However, in Python, it's a serious issue because Python uses indentation syntactically to mark block structure (instead of braces). So when an OP posts badly formatted code it can be hard to know if it's merely a formatting error that arose in posting the code, or if it's an actual error in their original source code. | |
Dec 20, 2021 at 22:04 | comment | added | Caius Jard | @Joundill honestly, I'm just glad when people format with code at all; I couldn't care less how indented it is | |
Dec 20, 2021 at 22:04 | comment | added | Caius Jard | @RyanM but note one should make sure the selection highlight runs all the way to the start of every line; making the selection highlight stop just to the left of the first word in the code makes it go haywire | |
Dec 20, 2021 at 13:28 | comment | added | Peter Cordes | @RyanM: that's the only thing I'd be worried about with a change to the editor for the code-formatting button (and ctrl-k shortcut) to use fences: whether that would leave you without a way to un-indent a block like you might want to in an old post that either shouldn't have used code-formatting at all, or has janky indentation inside the block, or that you're converting to fenced. | |
Dec 20, 2021 at 2:49 | comment | added | Ryan M Mod | Note for any aspiring editors having this problem: the correct solution is to select the code and click the code-format button to strip the existing indent, then add the triple backticks. | |
Dec 19, 2021 at 21:12 | history | answered | Joundill | CC BY-SA 4.0 |