Quantcast
Channel: Active questions tagged code-formatting - Meta Stack Overflow
Browsing latest articles
Browse All 163 View Live

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 Article

--- Article Not Found! ---

*** *** *** RSSing Note: Article is missing! We don't know where we put it!!. *** ***

View Article

--- Article Not Found! ---

*** *** *** RSSing Note: Article is missing! We don't know where we put it!!. *** ***

View Article

--- Article Not Found! ---

*** *** *** RSSing Note: Article is missing! We don't know where we put it!!. *** ***

View Article


Correct use of code block formatting?

Is the following correct use of a code block (the curly braces icon) in a Stack Overflow question?def __init__(self,rect_len,rect_wid,stylus_in): self.len = rect_len self.wid = rect_wid self.stylus =...

View Article

Pressing the quote button destroys text in code fences

Let's say I want to quote this shell code in a post:foo=barecho $fooFirst I put it in code fences so it shows up as code:```shfoo=barecho $foo```Then to quote it, I select it and either press the...

View Article

Code blocks surrounded by triple backtick then single backtick

Off the back of Code blocks surrounded by single backtick then triple backticks, it looks like the original problem was not exactly resolved, but more reversed.I'm seeing a lot of questions come...

View Article


Collapsible Code Markup

BackgroundWhen answering questions on SO I generally like to ensure that my code is runnable by including sample data, so someone can copy, paste, and run it, seeing exactly what I'd proposed.However,...

View Article


Image may be NSFW.
Clik here to view.

'Code zoom' feature to view code in expanded popup [duplicate]

Right now, viewing code on Stack Overflow is quite inconvenient as it's displayed in a small text box where lines don't wrap.I hope a "code zoom" feature can be added - similar to the one available in...

View Article

Convert-tabs-to-spaces Button [duplicate]

There are many questions on Stack Overflow with bad code formatting or wrong indentation.Usually this requires some work to fix when reviewing a question. Especially, when someone has a lot of code,...

View Article

My post "appears to contain code that is not properly formatted as code", but...

I was trying to answer a coding question in JavaScript. I had some code and used <pre><code>, put my code in, then typed </pre></code>. I then came across this error when trying...

View Article

Are code fences officially preferred yet? User found error message saying...

I found a question on SO where the asker had been presented with an "error" message:Oops! Your edit couldn't be submitted because:Your post appears to contain code that is not properly formatted...

View Article


Image may be NSFW.
Clik here to view.

When is it OK to upload images of code/data/errors? [duplicate]

When is it OK to upload images of code/data/errors?– If your answer is never, can we please talk about it?Don't get me wrong. I don't endorse uploading code/text in an image instead of uploading the...

View Article

Image may be NSFW.
Clik here to view.

How 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 Article


Image may be NSFW.
Clik here to view.

code 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 Article

Image may be NSFW.
Clik here to view.

Give 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 Article


Could 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 Article

Is 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 Article

Image may be NSFW.
Clik here to view.

Add 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 Article

HTML 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 Article


Can 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 Article


Image may be NSFW.
Clik here to view.

Font 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 Article

PowerShell 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 Article

How 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 Article


Image may be NSFW.
Clik here to view.

Cannot 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 Article

How 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 Article

When 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 Article

Image may be NSFW.
Clik here to view.

How 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 Article



Why 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 Article
Browsing latest articles
Browse All 163 View Live




Latest Images