Questions tagged [markdown]

Markdown is a plain text formatting syntax designed so that it can be converted to HTML using a tool by the same name. Markdown is often used to format readme files, for writing messages in online discussion forums, and to create rich text using a plain text editor.

Markdown is a lightweight markup language, originally created by John Gruber and Aaron Swartz, allowing people “to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML (or HTML)”. The language takes many cues from existing conventions for marking up plain text in email.

Markdown is also a Perl script written by Gruber, “Markdown.pl”, which converts marked-up text input to valid, well-formed XHTML or HTML and replaces left-pointing angle brackets (<) and ampersands with their corresponding character entity references. It can be used as a standalone script, as a plugin for Blosxom or Movable Type, or as a text filter for BBEdit.

Markdown has since been re-implemented by others as a Perl module available on CPAN (Text::Markdown), and in a variety of other programming languages. It is distributed under a BSD-style license and is included with, or available as a plugin for, several content-management systems.

StackOverflow uses Markdown.

This wiki entry was copied from Wikipedia.

Formatting using markdown

Different markdown dialects use slightly different formatting, but here are the general ideas:

You can use ** or __ to start and end bold text.

**Danger:** you need to prepare user inputs to avoid SQL injection.

You can use * or _ to start and end italic text.

_A Christmas Carol_ is a book written by Charles Dickens.

You can use backticks to format code text.

An `if` statement checks a condition, and runs code if it is true.

You can use ``` to format entire code blocks (like the one below)

Here is some code:
```
for (i = 0; i < 10; i++) {
    print "hi";
}
```

You can use > at the start of a line to insert a quote.

The specification says:
> You need to put x and y in brackets

Markdown dialects

A number of Markdown dialects are in widespread use, most of which add or enhance support for things like tables and links. Notable examples include

Babelmark may be used to compare the output generated by different implementations of Markdown.

Since 2014, you also have CommonMark, a strongly defined, highly compatible specification of Markdown (see "Standard Markdown is now Common Markdown").

7087 questions
4
votes
2 answers

Can Pagedown turn "\n" into
, just like MarkdownSharp's Autonewlines option?

I'm using markdown editor with Pagedown and MarkdownSharp. There is an option "AutoNewlines" in MarkdownSharp. I wonder how to do this in Pagedown (http://code.google.com/p/pagedown/). Thank you!
Chance
  • 1,207
  • 2
  • 12
  • 17
4
votes
3 answers

How do I auto-fill lines in brackets in emacs (markdown-mode)?

I'm relatively new to Emacs, but have been experimenting with it to see if it would be worth switching. I write in Markdown and use pandoc to convert to whatever I need. In case it matters, I'm running Emacs 23.3.1 on Ubuntu 12.04. I'm a graduate…
Brian Hamilton
  • 349
  • 2
  • 7
4
votes
1 answer

Pandoc ignores Markdown-Headlines

Using snap, I wrote a splice creating text from markdown, using this function: markdownToHTML :: T.Text -> [Node] markdownToHTML = renderHtmlNodes . (writeHtml writeOpts) . readMarkdown readOpts . T.unpack where readOpts =…
Lanbo
  • 13,437
  • 14
  • 67
  • 141
4
votes
2 answers

batch process docx to markdown

Any ideas on how I can get: textutil -convert html file.doc -stdout | pandoc -f html -t markdown -o file.md so that I can execute the command on a folder and all it's subfolders and so that the markdown file is placed in the same folder as the…
rev
  • 453
  • 5
  • 15
4
votes
1 answer

i18n markdown files in Rails 3 views

I am currently working through Michael Hartl's Rails Tutorial while experimenting with some other things not covered in the book. After completing Chapter 5, where the static pages are created, I decided change the view code to HAML,…
3
votes
1 answer

How to convert from VimOutliner to Markdown?

How could I convert a VimOutliner file to Markdown? In other words, I how to turn tab-indeted outlines like this... Heading 1 Heading 2 Heading 3 : Body text is separated by colons. : Another line of body…
martz
  • 799
  • 5
  • 20
3
votes
1 answer

Does a PageDown plugin exist for Jeditable?

I am using the jQuery inline editing plugin Jeditable. Thankfully, Jeditable provides a plugin capability for extending the out of the box inline editing it provides. I am hoping to not reinvent the wheel-- as such does a PageDown plugin already…
ahsteele
  • 25,470
  • 26
  • 131
  • 238
3
votes
2 answers

How to format markdown extra table?

I would like to format a table using using markdown extra / html. I would like every other row to have a grey background for readability. Also I would like to be able to set the width of the table. To accomplish the second part I tried this:
jack
  • 63
  • 1
  • 7
3
votes
2 answers

Escape from XSS vulnerability maintaining Markdown syntax?

I'm planning to use Markdown syntax in my web page. I will keep users input (raw, no escaping or whatever) in the database and then, as usual, print out and escape on-the-fly with htmlspecialchars(). This is how it could look: echo…
daGrevis
  • 19,600
  • 35
  • 95
  • 134
3
votes
1 answer

Reducing capabilities of markdown in python

I'm writing a comment system. It has to be have formatting system like stackoverflow's. Users can use some inline markdown syntax like bold or italic. I thought that i can solve that need with using regex replacements. But there is another thing i…
Mirat Can Bayrak
  • 555
  • 6
  • 17
3
votes
1 answer

Extendable/Customizable/Modular Lightweight Markup for PHP

Im planning a web application written in PHP (with Symfony) where I'd like to use a lightweight markup language. There will be two use cases in the app with different requirements: Short texts () where the user will need be able…
RoToRa
  • 34,985
  • 10
  • 64
  • 97
3
votes
1 answer

Porting a markdown-live-preview-in-vim plugin from *nix to Windows

I need your help. Because I've no idea what I'm doing. There is this nice plugin vim-instant-markdown I recently stumbled onto. Basically, it's a live preview in a browser, running in the background, while you're writing your text in markdown…
Rook
  • 54,867
  • 44
  • 156
  • 233
3
votes
1 answer

How do I render ``` code blocks in markdown with Redcarpet that are wrapped in divs?

If I have markdown like this: # A Header ``` javascript $(document).ready(function() {}) ``` It will render out like this:

A Header

$(document).ready(function() {})
The issue is, I want to have…
Lance Pollard
  • 66,757
  • 77
  • 237
  • 416
3
votes
1 answer

How to Highlight C# Syntax from Markdown Text in an MVC3 View

I have an MVC3 web app allowing team members to post and share code snippets. It currently uses PageDown (client-side) and MarkdownSharp (server-side) to handle the text in "markdown" text for persistence. So far so good. I want to implement syntax…
one.beat.consumer
  • 9,197
  • 11
  • 51
  • 96
3
votes
1 answer

How to run Markdown Extra on command line?

I realized I really need table support. And Markdown Extra offers it. The problem is Markdown Extra (PHP) doesn't work in the command line. I have many a shell script which utilizes original markdown's stdio piping feature. I don't know PHP well, so…
eonil
  • 75,400
  • 74
  • 294
  • 482
1 2 3
99
100