Questions tagged [code-formatting]
For questions about making code appear correctly in questions, answers and comments.
981 questions
12 votes
0 answers
162 views
Copying from `pre > code`s on SE prepends a license comment that might be interpreted as code when pasted
The last time that I extracted any content from SE, no ECMAScript intercepted that process to prepend license information. However, recently, at stackoverflow.com/a/28128802, I duplicated a text/x....
6 votes
0 answers
122 views
Copy button on fenced code blocks copies mixed Windows and Unix line endings
There's a new-to-me Copy button on fenced code blocks on various stack exchange sites now. When pressed, it puts a copy of the code block to the client's clipboard, along with a couple lines of ...
32 votes
3 answers
733 views
+100
The language chosen for automated labels in code blocks are sometimes incorrect
Per kristinalustig's request, I'm posting a standalone MSE report for all the different languages being guessed incorrectly via the new code block labeling feature that rolled out as part of the copy-...
0 votes
1 answer
92 views
How to apply text attributes in code blocks? [duplicate]
In bio.SE, I use code blocks to type out genetic code and related things like sequence of numerical position of codons like in this answer. So in this answer, I've added the following code block 123 ...
16 votes
0 answers
144 views
Text searches explicitly (and silently) excludes text in code blocks
It seems as though this non-intuitive search behaviour is known to people who know about it, but confuses people just searching for content, especially on Stack Overflow (and other sites where code is ...
7 votes
1 answer
116 views
Code samples in spoilers still have issues
Suppose I have a section of text in the middle of a spoiler and I want to put some in a code block such that it is surrounded by the spoiler text on both sides: If I try >! something >! <pre&...
6 votes
0 answers
87 views
Blockquoting XML removes characters, resulting in invalid markup
On the new Stacks editor, when quoting a code block containing XML comments, the comment opening tag is removed, resulting in invalid XML. Given a post with content like this: ``` <xsl:variable ...
10 votes
1 answer
233 views
Code block usability issues in Stacks Editor
Some issues with the new Stacks Editor's code block usage: Had to make it a GIF to upload here but the video is supposed to stop when I press the discard button and click the off-screen confirm box. ...
11 votes
1 answer
208 views
Use tag formatting on /help/whats-meta
At the bottom of What is "meta"? How does it work? is a section on required tags. It uses code formatting for these tags: Because meta-discussion sites are different and serve multiple ...
14 votes
1 answer
379 views
when typing code, backslashes are automatically inserted
Today I noticed the first time, that when I post an answer and enter code (by prefixing the line using 4 spaces), and my code contains a backslash or an asterisk, these characters are then prefixed by ...
3 votes
0 answers
58 views
Unable to make syntax highlighting working [duplicate]
Disclaimer: I'm more a reader than a contributor on Stackoverflow, so I may have missed something obvious for you all. I've posted this question (about some typescript issue), and added the Typescript ...
5 votes
0 answers
115 views
Arrow key navigation broken in code blocks in Stacks Editor
Steps to reproduce: Select the WYSIWYG mode of the new Stacks Editor create a code block add some text below the code block put your cursor into the code block press the down arrow key This will ...
8 votes
0 answers
205 views
Code blocks have no maximum width in expandable previews on Votes and All Actions profile tabs
I was looking at my upvotes in the Votes tab of the Activity section of my profile, and when I expanded the preview of a post with a large code block, there is a rendering issue where the code blocks ...
11 votes
0 answers
80 views
Can code-blocks get line-numbers? [duplicate]
I was peeking at a question that included two full scripts and an error message that referenced a particular line. I copy-pasted the code into VS Code to see the line numbers, but it would be ...
0 votes
0 answers
55 views
When user highlights more than 1 line of code and pressed 'code sample', make it a code block [duplicate]
When I enter multiple lines of code and then press 'code sample' or ctrl+k, the method of formatting is that it all automatically gets indented. However, I propose that any multi-line code should ...