How do I format my code blocks?
How do I post text so that it is formatted as code?What do I need to do so that my code shows up properly—not escaped or removed—when posted? And how do I get the correct syntax highlighting?For more...
View Article--- Article Not Found! ---
*** *** *** RSSing Note: Article is missing! We don't know where we put it!!. *** ***
View ArticleHow is table with code formatted incorrectly? [duplicate]
Why is this table not formatted correctly?Base (base)Exponent (exp)Math.pow(base, exp)numeral(n).format('0[.]00e+0')logFormatter(n, base)10-50.00000999999999999999910e-61 x...
View Articlecode formatting lost after edit, revert would not fix it
I made an edit to this answer, (changed "unicode" to "str") however when I saved the edit, the code formatting was lost. I quickly reverted the edit, however the code formatting was still lost after...
View ArticleGive a code block a filename
It's relevant and useful to include the name of the file that a code block should go in. For example, an update to a Next configuration would go in the next.config.js file, an NPM script would go in...
View ArticleCould preview display scrollbar in code format correctly?
When I write regular code snippets the preview shows a scrollbar when the number of lines > 36 it previews that there will be a scrollbar, while in fact, the scrollbar appears only after the number...
View ArticleIs having the ability to apply rich text formatting inside code blocks...
For many years, it's been possible to apply rich text formatting to code blocks inside posts by formatting the code block using the HTML tags <pre><code> and using more HTML tags inside the...
View ArticleAdd visual difference for negative code examples
I see that often someone makes negative examples and marks them either with //DON'T or similar. I think that is not enough; one should be able to visually tell positive from negative examples. For...
View ArticleHTML formatting inside highlighted code blocks is no longer supported - how...
This question isn't relevant anymore since the site once again supports HTML formatting inside code blocks. Stack Exchange implemented the plug-in workaround noted in the answer, to resolve an issue...
View ArticleCan the New Question wizard check for multiline code inside single backticks?
Every day I fix up numerous questions that have multi-line code blocks enclosed in single backticks rather than triple backtick code fences. Or they don't put a newline between the triple backticks and...
View ArticleFont in code blocks [duplicate]
Has the font in code blocks changed recently? Is this intended?Being exclusively active in the r tag, I'm very irritated by the distracting misalignment of < and -, which together are the assignment...
View ArticlePowerShell Syntax Highlighting
I mainly answer PHP questions where syntax highlighting has always worked for me with just indentation. I've just started using PowerShell and have asked a couple of questions and syntax highlighting...
View ArticleHow can I include new lines for code snippets inside comments?
I want to write short code in a comment like:function ngWrap($scope, fn) { return function() { var args = [].slice.call(arguments); if (!$scope.$$phase) { fn.apply(null, args); } else { return...
View ArticleCannot figure why am getting "Your post appears to contain code that is not...
I tried changing every section in the code below (using/not using four character indentation with/without pre). I also tried removing the formatting and the line separators on the list.Nothing helps -...
View ArticleHow should compiler errors, linker errors and logs be formatted?
How should I format compiler errors when I want to put them in code?Should they be in a code section:dk2.cpp: In function 'int main()':dk2.cpp:29:28: error: no matching function for call to...
View ArticleWhen should code formatting be used for non-code text?
I reviewed an edit that did no change to the post apart from introducing code formatting like this to words that aren't code, such as iOS and Android (while curiously leaving Delphi untouched). I...
View ArticleHow to fix the error "your post appears to contain code that is not properly...
How do I fix the below format? I keep getting the error:"Your post appears to contain code that is not properly formatted as code." My code is indented 4 spaces and is between '''codeblock fences'''.My...
View ArticleWhy is there no line numbering in code sections?
Many times users paste long code and those who want to refer to a specific line refer to it by its content, which can be misleading or cumbersome if the content appears elsewhere or the line is long.I...
View ArticleHow to display a pandas dataframe on a Stack Overflow question body
I need to display a pandas dataframe in a Stack Overflow question body. I have already tried to display copying and pasting in a block of code but got completely unreadable.This is result I got: id...
View ArticleWhat causes single backticks on every line of code?
There is an issue where code blocks contain single backticks around every single line, rather than triple fences around the entire code block. This destroys the formatting. An example can be seen in...
View ArticleOption to open code-blocks in fullscreen
As the title says, can SO introduce a button/shortcut to be pressed on which the code block/s provided inside question/answer could stretch out fullscreen and can be reverted back.The need for this...
View ArticleIndent/dedent in the Stacks Editor
I would love to have an indent and dedent keys in the new Stacks Editor.This has already been requested for the old markdown editor, but the request seems to have been ignored, and it seems like the...
View ArticleBacktick formatting in numbered bullets is missing the background in the...
In the iPhone mobile app, code formatted with backticks in bullet points has no background whereas the the same text has a grey background elsewhere.In this question of mine the new text in the...
View ArticleWhy does this code block have weird formatting?
COMMAND and OUTPUT is formatted as italics in this post. I know <pre><code> can be used to format text in code blocks, but that answer uses just a normal code fence ``` ```. Here's the...
View ArticleCode block adjustment
One of the things I've noticed quite often is someone will present their code like this:if( $a > 5) { echo $foo; // why isn't it showing today?}?>People then comment and sometimes...
View ArticleWriting a code sample is ugly
Is SO against including code samples with questions or answers.BecauseThe answer input box is very small. It doesn't auto expand to fit its contents when editing a question/answer. And doesn't remember...
View ArticleAuto-unindentation for code blocks
Can code blocks like this:for (var i = 0; i < 10; i++) { console.log('hi'); } console.log('done');Be converted to this?for (var i = 0; i < 10; i++) { console.log('hi');}console.log('done');There...
View ArticleCreating a code block in Staging Ground includes one additional character...
When you edit a question in the Staging Ground to convert a text selection into a multiline code block by using the "Code block" button (or pressing CTRL-M), a code block will be entered which contains...
View ArticleCan I force syntax highlighting for a certain language? [duplicate]
I notice that stackoverflow automatically adds syntax highlighting to code blocks. I hate this. It always applies the wrong language's highlighting to the wrong code.Example? The last question I've...
View ArticleDiscussions garbles code [duplicate]
I am trying to respond to a Discussion (pushed upon us by the frustrating comment experiment), and it eats my code. I want to put this code there:# 2. Identify peaks ----peaks_info <-...
View Article