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 ...


177

Allowed HTML Tags The Stack Exchange engine allows only the following safe, whitelisted subset of HTML tags: <a> - hyperlink. <b> - bold, use as last resort <h1>-<h3>, <em>, and <strong> are preferred. <blockquote> - specifies a section that is quoted from another ...


170

Benefits Compatibility with GitHub-Flavored Markdown and other Markdown libraries that support this de facto standard (and possibly its variants). This enables copy-pasting from gists or Markdown files within repositories, which can be useful on programming-related sites like Stack Overflow. The triple backtick syntax is easier and faster to type than ...


142

Unfortunately, this is an ambiguity in the Markdown specification. This markdown source: 42. list item more text can mean two things. One of them is the one you're expecting: more text is following a blank line and indented by four spaces, making it a top-level (i.e. not part of the list) code block. The second possible meaning is this: List items ...


130

For github, like for displaying a mysql `table_name`, in regular text use \` (backslash backtick) For showing backticks inside inline codeblocks `table_name` use double backticks with extra spaces `` `table_name` `` around the inner single backticks. To show the previous example explanation in an inline codeblock: `` `table_name` ``, surround the whole in ...


124

Elsewhere on Meta, I once learned about the nice Senseful Solutions Format Text as a Table tool.The same facility is now available at the ASCII Table Generator. Of course: It's not at all accessible, so not a replacement for true tables. It's not Markdown. It's an extra step. The resulting ASCII tables don't work well on mobile, if too wide, as the mobile ...


124

You can strikethrough with the HTML tag <s> and the close tag </s>. Like so <s>Like so</s> In chat this effect can be achieved with --- ---Like so--- Don't use it too often, though; it doesn't look very good.


101

Correct, they should be used for code (and code-like artifacts). If that's the only change, and it's wrongly applied, reject as "no improvement whatsoever" or "causes harm". I don't have a problem with filenames, paths, API methods, commands, etc.–those are computery "artifacts" that should be differentiated from expository text. Products, trademarks,...


100

You can do this: Header 1Header 2Header 3 Cell 1      Cell 2      Cell 3       Cell 3      Cell 4      Cell 5       Cell 6      Cell 7  &...


91

<kbd>shift</kbd> + <kbd>command</kbd> + <kbd>3</kbd> outputs: shift+command+3


89

As a workaround, you can easily embed LaTeX by generating an image of the equation using the following WYSIWYG editor: https://codecogs.com/latex/eqneditor.php.


84

Use <pre> formatting and HTML tags. <pre> sample <b>sample</b> sample </pre> Gives: sample sample sample Since you can use other HTML tags as well, this is nice for including inline documentation for commands or classes, etc.: <pre> <i><a href="http://manpages.ubuntu.com/manpages/dapper/man1/prename.1.html"&...


82

Is there any script (windows, linux or webapp service) that provide formatting ? There's the tree command (exists in both Windows and unix/linux) which does it rather nicely. For example, here's a small portion of the dir structure for Python-2.7.3: [me@home]$ tree Python-2.7.3 | head -n 11 Python-2.7.3 ├── configure ├── configure.in ├── Demo │   ├── cgi │ ...


68

Use <sup> and <sub>: This is a <sup>superscript</sup> This is a <sub>subscript</sub> This is a superscript This is a subscript Using <pre><code> blocks, because they're strange, lets you do this as well: <pre><code>This is a <sup>superscript</sup> This is a <sub>subscript&...


65

Here's what I do1 to simulate footnotes: These lines are _going to_ intersect<sup>1</sup>! ... -------- **Footnotes:** 1. See Euclid's 5<sup>th</sup> postulate. It's not that hard to do, but it's still a pain and the results aren't ideal. There's no easy way to set up links from the footnote mark to the footnote text and back ...


63

Given that the vast majority of people want this feature, CommonMark, which we eventually hope to use, supports it, so it would come eventually anyway, the impact should be minimal since most Markdown lists start with 1., even where this isn't the case, nothing will change until the post is edited (we don't automatically re-render questions and answers), … ...


63

You can type two spaces    and press Enter. Like so. I wanted to write some columns with values as in an Excel spreadsheet For longer/pasted text, you can also format as code in many ways, like by indenting with 4 spaces, or by using <pre></pre> tags (which need manual encoding of HTML), like so: Column 1 Column 2 Column 3 ...


60

I like this suggestion. I would really like to use this feature when making suggestions for new badges. I have a few minor thoughts: Don't force the syntax to only support existing badges. The current markdown for tags allows for linking to tags which don't exist: excellent-suggestion-by-chris. My suspicion is that this is to minimize server load -- ie. ...


55

Traditionally, these requests have been closed as dupes of Numbering/bullet interpretation bug?, but I'll keep this open since I think it's worth reconsidering. Even John Gruber's original Markdown documentation says If you do use lazy list numbering, however, you should still start the list with the number 1. At some point in the future, Markdown may ...


53

You can use an extra backtick at the start and end to make sure it escapes correctly: ``List`1`` When inline it will display as List`1. Markdown provides backslash escapes for the following characters: \ backslash ` backtick * asterisk _ underscore {} curly braces [] square brackets () parentheses # hash mark + plus sign - minus sign (...


52

On Stack Overflow, all the time I'm seeing this happen to people who don't know the syntax. class Foo { public static void main(String[] args) { // y my code no is working Sytem.out.println(qrew3r); } } Some people stop there and never fix it because it's close enough. Others figure out that the first and last lines aren't part of the code block ...


51

The standard way of including code is by indenting it all with four spaces: like so (literal text: "    like so") Or, for inline blocks, surrounding it with backticks like so (literal text: "`like so`"). As you've seen, using <pre><code> has unexpected limitations and also doesn't support nifty stuff like automatic ...


49

more <kbd> abominations: First Name DonaldMickyRoger Last Name DuckMouseRabbit First NameLast Name Donald Duck Micky Mouse Roger Rabbit


47

Is it improper? Of course. The <kbd> element is meant to represent user input. It is not a means of making links look fancier or "styling" your posts, so to speak. It has a semantic meaning that should be obeyed and should not be abused. Just like we only use inline code for code and we don't use all-capitalized letters to emphasize text, we shouldn't ...


41

Underlining as a typographic means of emphasis is a relic of typewriters and handwriting. I'm not saying these two are dead (at least not both of them), but underlining is far inferior to bolding (for emphasizing and having it stand out from the rest of the text) and italicizing (for emphasizing but leaving the text's gray value intact, thus not standing out)...


40

<del> also works. As you can see here. It might be more semantically correct, especially if you include the "datetime" attribute.


40

We don't have "highlighting" here. We have formatting, and formatting serves a semantic purpose: Italic text is for emphasis, like the HTML <em> tag. Bold text is for strong emphasis, like the HTML <strong> tag. Code formatting is for inline code snippets, like the HTML <code> tag. You do want to make sure that you do not overuse emphasis,...


37

Maybe they're not really useful on SO, but there are lots of places on *.SE where they could come in handy (e.g. cstheory).


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