Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [code-block]

is for questions about the block formatting used for code in posts.

0
votes
0answers
35 views

When typing code as a code block in Stack Overflow, the tab key selects the post button instead of indenting [duplicate]

I use Stack Overflow too for programming questions. Mainly C programming. I include code blocks in my question by typing. Good code is properly indented, such as code in functions are supposed to be ...
-4
votes
1answer
67 views

How to write blocks of code [duplicate]

I really hope someone out there could help me understand my doubt regarding posting/answering with a code block on Stack Overflow. OK, so I posted the below R function a while back, and as you can ...
3
votes
0answers
21 views

Incomplete rendering of code blocks in Android app [duplicate]

I'm running the Stack Exchange app v1.0.95 on a Samsung Galaxy S7 Edge running Android v7.0. Over the last few days, I'm noticing that the app doesn't fully render code blocks anymore. It renders ...
-4
votes
1answer
62 views

Add a way to highlight/emphasize changes in code [duplicate]

Answers to coding questions often use a minor change to the example code. But because it's code, you cant emphasize those differences with markdown syntax. See example below where I've done some ...
2
votes
0answers
20 views

Unnecessary backslash characters added when hyperlinking code block with brackets `[]` [duplicate]

While writing a post, if the hyperlink tool is used on a code block containing [ or ], the tool will add extraneous backslash \ characters in front of the brackets. Example: user:351462 [support] -> ...
9
votes
0answers
54 views

Excessive tabs in an inline codeblock cause repeated sideways scrolling of chat window for other users

This affects at least Firefox. When a message has an inline codeblock containing a long string of tabs this causes the chat window to have a horizontal scrollbar and to scroll spontaneously left and ...
2
votes
0answers
16 views

Horizontal scroll bar occludes text

I've been running into this lately. The scroll-bar gets stuck and makes it difficult to read the text. I'm running Chrome Version 56.0.2924.87 (64-bit) on macos.
2
votes
0answers
1k views

Horizontal scroll bar appears in Google Chrome when not needed (line with 93 characters with default zoom)

The horizontal scroll bar appears in Google Chrome (with default zoom) when a line 93 has characters, which isn't needed. Example: model_saver.save(sess, os.path.join(model_folder, 'model_{0:05d}....
2
votes
0answers
17 views

Inconsistent code highlighting on the iOS app

I've noticed a few posts with code blocks that aren't getting any syntax highlighting when they should. This Q&A for example has no highlighting: Whereas this Q&A does: The strange ...
30
votes
0answers
111 views

Don't auto-replace Amazon links in codeblocks

In this question a user is asking about how to scrape an Amazon URL. The included MCVE contains the URL as a string literal: However, anyone visiting the question can't see that URL, as it is ...
5
votes
0answers
65 views

Code blocks do not show completely in Android 5 mobile app

Very long code blocks get truncated, this is a problem for CodeReview where long code blocks are common. The problem was not seen on Android 4. Example question were the bug is seen Brand: Vodafone ...
2
votes
0answers
51 views

UX feature: Option to make code part of the question as sticky or fixed (preferably at bottom-right of viewport)

I would really love a feature where the user has the option to detach code part of the question or (perhaps every code block) and make it a sticky or affixed, preferably to bottom-right of viewport. ...
6
votes
0answers
1k views

Code block markdown formatting using <pre>

The official Markdown syntax reference page says (emphasis added): The only restrictions are that block-level HTML elements — e.g. <div>, <table>, <pre>, <p>, etc. — must be ...
5
votes
1answer
67 views

Can a user script modify or apply syntax highlighting in SE sites?

SE currently use Prettify for syntax highlighting. However, there are still some languages which have no support from default Prettify, or by the extensions that SE may be using. If I wanted to test ...
1
vote
0answers
21 views

Bugged long code view in Android app? [duplicate]

When there's a long code section without a new line, I'm able to scroll horizontally, but the box moves instead of the code inside it. I'm on Android 6.0.1 using SE app v1.0.83. Example post on SO
13
votes
1answer
98 views

Add an indicator for the license to code blocks and a tool to copy code with the proper attribution

I think it is a fair assumption that a large number of people using Stack Overflow and other programming SE sites don't understand or don't even think about the implications of the license when using ...
16
votes
0answers
134 views

Insufficient padding on one-line markdown pre tag

When scrolling through a code-block that is one line high on OSX the scroll bars appear when you hover over to scroll and obscure over half of the text. Chrome: Firefox: It's very distracting. It ...
4
votes
2answers
74 views

Code goes beyond the box, allowing you to scroll the whole post

You're able to scroll the whole post! This shouldn't happen. I believe the correct behavior is to not scroll the post, but scroll the gray code box that pops up when you click on it. Android 5.1.1 on ...
9
votes
0answers
51 views

Code blockquotes on beta sites add extra spacing to bottom

Currently, when you try to format blocks of code inside a blockquote, you get extra spacing at the bottom of the blockquote. Here are a couple of examples: While this isn't a huge deal, it ...
9
votes
1answer
513 views

Code popup crashes the Android app

After the most recent update of the Android app, when I click on some code blocks, the app crashes. I still don't know for sure why this happens. Stack Overflow code blocks work perfectly while ...
1
vote
2answers
391 views

Strong, bold, and backtick not working when trying to style a text piece [duplicate]

Please, take a look at this post in SO. I've tried to make some part of the text bold to make the change noticeable. But it doesn't make it bold, instead it just adds leading and trailing **. Here, in ...
3
votes
0answers
33 views

Code popup visible outside of app

I don't really know how this happened. I was in the feed, then I exited out of the app and suddenly I got the popup.
5
votes
0answers
85 views

Long lines in quoted code block scroll bar issue

I saw some question like this but they seemed to be specific to iPad or Android. This problem happens on the main site as displayed in a regular web browser on a computer. I took screenshots of the ...
6
votes
0answers
148 views

Allow hiding Stack Snippets (or code block that long enough) on Android app

On Stack Overflow, I'm not a regular in html, javascript, or css, so I rarely encounter Stack Snippets. But when I browse "Page not found" is a bit of a mess, I didn't expect the snippet to ...
11
votes
2answers
207 views

Code block markdown missing from question & answer summaries

The answer summaries shown in search results appear to strip out code block markdown from the text. For example, the second item in this query doesn't show the code block markdown content of this ...
1
vote
0answers
34 views

Add 'Enlarge' option to code blocks [duplicate]

I would like an 'enlarge' option for text blocks that are wider than the window, such as an enlarge link below wider blocks, or something similar. I did find this question about resizable text blocks,...
9
votes
1answer
85 views

Code popup has ridiculously small font on Android app

The code popup that appears when tapping inside a code block sometimes has a ridiculously small font. For example: an answer on PPCG.SE. (Click the image for full-size) Nexus 5, Android 5.0.1 (...
4
votes
1answer
277 views

nested formatting inside code block

I couldn't find an answer here in the Markdown Editing Help page. What I am trying to do is this: This is a block quote area where I would put code or a quote and I can bold text and add a cool ...
27
votes
1answer
179 views

Code block Prettify for Code Review after graduation

Some Code Review regulars have been discussing on Code Review Meta and in chat the possibility of redesigning the look of code blocks as part of eventual "graduated" site design. Would you please ...
3
votes
1answer
542 views

Make first line of code empty in code block

If you write code you usually start by making 4 spaces which starts a code block. This does not work when the first line is empty. The line above this one should be empty and gray like the one below ...
4
votes
1answer
60 views

Scrolling code in Android app causes display oddity

When I use the Android app and use my finger to scroll the code over, the blue triangle in the upper-right corner moves with the code! Versions: Stack Exchange: 1.0.30 Android: 4.4
3
votes
0answers
44 views

Starred fixed-width messages break in the starboard

FHRC#1 indicates a backquote in a chat message using fixed-width formatting, which is (correctly) output literally. FHRC#2 shows that the same backquote is misinterpreted by the sidebar starboard as a ...
3
votes
1answer
138 views

Cannot post on Stack Overflow

Why do my posts keep failing? I am trying to ask a question relating to C# and ASP.NET and it keeps making me verify I'm not a robot or script or just spins for a long time and then says it can't! I ...
4
votes
1answer
117 views

Codeblock shows blank area when scrolled down [duplicate]

When looking at this question and scrolled down the codeblock I saw this: Under the horizontal scroll bar there is a blank area still in the codeblock. I have never seen this before so I thought it ...
9
votes
0answers
397 views

In the Android App, make code blocks indicate their new behaviour

The Stack Exchange android app has a neat new feature: code blocks that are super wide get cut off, and you can tap them to pop up a code view in which you can scroll around to view the whole thing. ...
6
votes
1answer
128 views

Can't read code blocks from the Stack Exchange android app

This occurs in the Stack Exchange android app released recently to the public. When someone posts a code block in their question or answer, the code block is cut off on the right hand side, and I can'...
5
votes
1answer
10k views

How to add line numbers to the code lines? [duplicate]

is it possible we have the option of adding line numbers to the beginnings of the code lines added to the questions and answers? This is a needed fonctionality especially when responding to the long ...
1
vote
1answer
59 views

Add a way to scroll code [duplicate]

It's currently impossible to read long lines of code in the Android app, as swiping will move from question to answer
0
votes
1answer
49 views

How to add a block of code in question? [duplicate]

I am new here & trying to ask a question about C++ on Stack Overflow. The question contains a long code & I don't know how to add it in short time. I tried to use code sample tool provided ...
3
votes
0answers
25 views

Using back-ticks to show code doesn't allow you to start with a space? [duplicate]

Referring to the comment I made here MySQLi Select hashtag from table Trying to use # someTag did not work so well for me in the comments and same thing goes for this post, edit this post and you ...
11
votes
1answer
54 views

Warn users that are posting code on meta

I'm pretty sure the parser is able to recognize code in the body of a post. Should we give a warning to users that are trying to post some code on Meta ? What is meta, how does it work ? ...
-6
votes
1answer
109 views

Offer code as downloadable file [duplicate]

Maybe I am not the first one who got this idea. There are many programming questions asked and answered on these sites. My idea is when the question or answer consists of a lot of code and the user ...
1
vote
2answers
234 views

How to easily copy, download, or view all of “code box” in question? [duplicate]

Some questions contain long code listings, and it is often required to copy, download, or view the code in full, and maybe past/download it to a local file for compiler experiments. Is there a better ...
2
votes
0answers
135 views

Panning in code blocks

Would it be a good (and feasible) idea to have panning in code blocks? People keep pasting these wide-spaces unreadable code blocks. I'm sometimes willing to do someone else's styling job, but not ...
4
votes
0answers
899 views

Unexpected border on Stack Overflow code sections with IE11

A code section like this: for (int i = 0; i < 10; ++i) Often (but not always) is rendered like this (with an unexpected 1 pixel solid line on the left): I saw this strange behavior only on IE11 ...
11
votes
0answers
124 views

Can we provide better feedback to people who answer by modifying the question?

As a edit moderator (2k rep), I now see many many many edits that are actually new users answering the question. This most often happens where a code modification occurs. Many of these answers look ...
2
votes
1answer
148 views

Displaying code blocks within quotes

Please see this answer: Javascript Function toString The response is quoting from http://shamansir.github.io/JavaScript-Garden/en/#object, which has some text segments and some code segments. What ...
5
votes
1answer
231 views

Indicator for width (length of lines) in code boxes

It is generally agreed that posted code is best formatted so that the horizontal scroll is not required for the code box in most cases and for most users. I have conducted surveys here and on Meta ...
1
vote
1answer
57 views

Toggleable Code Blocks [duplicate]

One nice feature would be if the source code was automatically hidden when the question is too big, and clicking on something be able to make the code visible. In this question people are asking a ...
10
votes
1answer
270 views

1st post rejected: “Your post appears to contain code that is not properly formatted as code”

Trying to post answer to this question: WinDbg x64: Cannot debug a crash dump - failed to load data access DLL Get this message: Your post appears to contain code that is not properly formatted ...