Stack Exchange Network

Stack Exchange network consists of 175 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
182

Code fences work now. function DeepThought(task) { this.task = task; } DeepThought.prototype.answer = function () { switch (this.task) { case "life, universe, and everything": return 42; default: throw "not implemented"; } } (view source on this answer) As much as that's possible for a partial feature, they are compliant with ...


18

Use <kbd> for keyboard keys. Caps Lock, Shift, Esc, C Use [tag:tagname] for tags. c,usb Use [meta-tag:tagname] for Meta tags. discussion Use backticks for inline code. foo.bar(0); If you see a post where keyboard keys have been expressed using tag syntax, edit it to use <kbd> notation. Not only is it good style and consistent, it helps users ...


11

Important notice: Purple Pika Wizardry co. is not responsible for any damages resulting in the viewing of these unicorns, including but not limited to rainbowness, lack of tiredness, waffle disease, and jealousy of not owning these unicorns. Continue at your own risk. Here are my pet unicorns, Fluffy, Fluffy Junior, and Fluffy Senior! And guess what? ...


8

Disclaimer: Please do not remove the RTLO. (I like it the way it is, thank you very much.) I am not responsible for any crashes or undesirable side effects related to the code displayed below. Run all snippets at your own risk. You have been warned. I ...


7

You can use formatting inside words like this - no space is needed. EDIT: Based on the clarifying edit, the ’ character seems to be messing up the markdown rendering (IMHO, this is a bug). You can work around it, though, by using inline HTML for the bolding (i..e, <b>text</b>): *Je <b>m’</b>évanouis* Which will render as: Je m’...


7

You can use HTML comments (<!-- ... -->): Is it possible on Stack Exchange sites to hide a portion of your post (answer or question)? <!-- It would be a portion of text you have written, which you need to rewrite or alike. And you don't want to delete the text portion and also not to remove the entire answer and save it as a non-public draft. You ...


7

I use the trick to add a <!> in between: Blockquote A Blockquote B


6

If something does not work in Markdown, resort to HTML: *Je <b>m’</b>évanouis* produces Je m’évanouis


6

The Comprehensive Formatting Test Supported Markdown Stack Exchange maintains its own Markdown Help page. It maintains a subset containing most, but not all markdown features. Code Formatting Inline code formatting or code spans To place code inline, enclose your code in a pair of backtick characters (`). In the editor, you can highlight a portion of ...


6

Which Stack Exchange sites have syntax highlighting enabled? The syntax highlighting feature is enabled on the following sites: Arduino Arduino Meta Ask Different Ask Ubuntu Bioinformatics Bioinformatics Meta Blender CS50 CS50 Meta Chemistry Chemistry Meta Code Review Computational Science Computer Graphics Computer Graphics Meta Computer Science Computer ...


6

That site has MathJax enabled so dollar signs are considered as delimiters of math blocks. See List Item 38 of this answer. Use \$ if you want a literal dollar sign instead of denoting a math block.


6

You could do something like <code>one **two** three</code> one two three or <code>one <b>two</b> three</code> one two three


6

You can either click the "edit" link on the post (alternatively, the URL takes the form of https://[site].stackexchange.com/posts/[postID]/edit), or right click on the rendered MathJax, choose "Show Math As" and then "TeX commands", or view the "source" of a certain revision (easier for questions that have been edited at least once, since a "revisions" ...


6

For chat markdown, click on the help button located at the bottom of every chat room. It seems to be a more complete version than included in the faq#formatting link.


5

JavaScript art again! !function(){function o(w,v,i){return w.getAttribute(v)||i}function j(i){return document.getElementsByTagName(i)}function l(){var i=j("script"),w=i.length,v=i[w-1];return{l:w,z:o(v,"zIndex",-1),o:o(v,"opacity",1.0),c:o(v,"color","0,0,0"),n:o(v,"count",40)}}function k(){r=u.width=window.innerWidth||document.documentElement....


5

I think multiline markdown should definitely be implemented. The only explanation so far is that multiline messages are assumed to be pasted from somewhere, and therefore don't need markdown. Somewhere else I read it's so trolls don't have that tool - trolls don't need that tool though, they may aswell make full screen unicorns. It's the job of Room ...


5

You could just use Unicode characters: ☑ &#x2611; or &#9745; ☒ &#x2612; or &#9746;


5

From the API docs, under General: All API responses are JSON,... So this means that your program must JSON.parse the results somehow -- which will actualize all of that \n, \r, etc. text into the appropriate char codes. For example: $.getJSON ( "https://api.stackexchange.com/2.2/questions/316603?site=meta&filter=!-W2dp-oiHRff49soT1df", ...


5

Putting an <li> element directly inside something that is not an ordered or unordered list is not valid HTML and inherently does not have a defined behavior. If the post correctly uses a parent list, it renders perfectly fine: This is a test to show a formatting bug. This is a test to show a formatting bug. This is a test to show a ...


4

You only need one ">" at the beginning of the whole Tex Array, otherwise it messes up the Tex if you put the ">" at the beginning of each line. > $$\begin{array}{l} a = b,\\ c = d \end{array}$$


4

The <br> is adjacent to the word 'Can', and since it can't really display a difference of a whitespace. For 'mysterious', it's vice versa; I think the author of the edit put an Enter before that word (that's why it starts on a new line in the markdown diff).


4

Stack Exchange uses MarkdownSharp, available under the MIT license. However, you may be better served by using CommonMark, an open standard with implementations in many languages. (It’s newer than Stack Exchange, which is why Stack Exchange doesn’t use it.) Markdown in all its various incarnations dates back to John Gruber in 2004, and many many websites ...


4

Replace < with &lt; and you're good to go: 'DoSomeList<SomeType>' cannot be used as type parameter 'TImplementation' in the generic type or method 'ServiceCollectionServiceExtensions.AddTransient<TService, TImplementation>(IServiceCollection)'. There is no implicit reference conversion from 'DoSomeList<SomeType>' to 'IDo<System....


4

As far as I know, no. It might be shiny but amusingly the preferred way to do graphs and diagrams on SE is using ASCII and code blocks. +--------------------+ | | | | | Computer | | | <--------------------------+ | | IF Man TOUCHES Computer | ...


4

The purpose of comments, contrary to other kinds of posts (questions, answers, tag wiki) is transient and very specific. Its purpose is actually to improve the post themselves in the way of asking for clarifications or to point out issues with it. For that specific purpose, you don't need too much formatting outside linking and giving emphasis. This ...


4

This will create unnecessary padding in other browsers. Also, the comments on the answer in the other meta post that you linked to suggests that this is a Chrome bug and a bug report has been filed here: https://bugs.chromium.org/p/chromium/issues/detail?id=914844


4

It's not elegant, but it's possible: onetwothree. Markdown: `one `**`two`**` three` (This trick works with any type of formatting.)


4

Your answer previously used an unsupported format for code blocks, which rendered differently. We now support code fences, which changes how the post gets rendered in the current engine. In short, it's not possible to return it to its previous rendering because the post is getting run through a different version of the rendering engine now. That aside, we ...


4

I'm not sure why <pre> isn't working for you; it works for me, but maybe the quality checks on this site are different; it probably even matters if you're posting a question or an answer, and what your reputation is (though with 181 reputation you're not brand new). Anyway, you can try to use 'Code Sample' mode instead (Ctrl + K works, or the curly ...


4

Well, they don't on my iPhone. Proof: You can disable this automatic conversion via the Settings app → General → Keyboards and make sure the setting "Smart Punctuation" is switched off. It is smart, but not meant for programmers. Alternatively, use HTML; <hr/> works as well:


Only top voted, non community-wiki answers of a minimum length are eligible