199

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


192

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


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


152

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


142

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


108

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


106

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


104

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


101

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.


97

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


84

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


67

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


67

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), … ...


66

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


66

For these posts, we’ve built a tool that automatically fixes these well-known issues by changing a post’s Markdown source directly and re-rendering the HTML of the post in question. When we change a post’s Markdown automatically, this will end up looking like a regular edit but we’re making sure that this won’t bump posts to the top. What will this do for ...


64

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


59

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


54

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


54

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


54

Migration Schedule Here's an overview of the sites we're going to migrate, when we're planning to run the migration and the current status of that site. I'll keep it updated as we go. We might run into some issues along the way, so please understand that predicting an exact timeline is hard and we're going to adapt as we go. Done CommonMark is active, posts ...


52

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


48

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


45

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


41

If you want to reference special keys such as ⌘ Command, you can use these special characters: Mac: ⌥ Option ⌥ <kbd>⌥ Option</kbd> <kbd>⌥</kbd> ⌃ Control ⌃ <kbd>⌃ Control</kbd> <kbd>⌃</kbd> ⇧ Shift ⇧ <kbd>⇧ Shift</kbd> <kbd>⇧</kbd> ⌘ Command ⌘ <kbd>⌘ Command</kbd> <kbd&...


40

<sub>+<sup> seems like a horrible answer, really. You're mangling your HTML markup to get a particular display style with completely different semantic meaning — and you're assuming default display implementations of <sub> and <sup> while you're at it. I would love a <small> or "footnote" markdown syntax too (that's how I ...


40

Stack Overflow doesn't support MathJax, but stats.SE and math.SE (full list) do. With MathJax, you can use array to create tables: \begin{array} {|r|r|} \hline 1 &2 \\ \hline 3 &4 \\ \hline \end{array} Which translates to this: (Sadly, it would seem meta.SO does not support MathJax either, but if this could be brought about, it would be ...


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


40

Regarding the question "will it break too many posts?", what Adam Davis says is correct. So when we switch (and at this point I'm fairly certain that it's "when", not "if"), the most important thing to know is that this won't suddenly change old posts. Here are some thoughts I currently have about the switch. I'm just thinking aloud; we haven't decided ...


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