19 ms·
The Future of Markdown
- kbd 14y agoHere's hoping they can finally work natural _underline_ support in... Edit: I've wondered whether the original Markdown didn't have underline support because <u> was deprecated/removed from HTML. FWIW, <u> is now back in HTML5.
- phreakhead 14y agoUnderlines traditionally have semantically meant the same as italics. When an editor wanted the printer to make a certain word italic, he would underline it in the draft. Really, underlines are a useless decoration. That's why HTML took them out. Not sure why they put them back in...
- dbh937 14y agoLike you said, they are a decoration. When handwriting something, some people use underlines for different kinds of emphasis. Those people want to make text look a certain way. It's good that HTML5 brought back underlines, just in case someone wants to use them, they at least have the option.
- stan_rogers 14y agoThe primary reason is to provide for Chinese proper name marks (where underlining has a semantic meaning) and occasionally for misspellings (in English, we'd probably add the editorial text [sic]). As a decoration, it is useless, but there are circumstances where it has semantic meaning. (The <b> and <i> tags were promoted back to respectability for the same reasons, since using <em> for text that is not stressed or <strong> for text that would traditionally be bolded without implying extra importance is just as semantically incorrect as using <i> and <b> for stress and importance would be. Arbitrary spans don't imply any semantic meaning. Where I would have used <span class="foreign" lang="fr"> previously, I'd now use <i class="foreign" lang="fr">. The <i> tag marks the text as special rather than just arbitrarily styled.)
- masklinn 14y ago> The primary reason is to provide for Chinese proper name marks That's an improper use, you want {COMBINING LOW LINE} U+0332 for that.
- rsl7 14y agoyup. i'm there.
- matthewowen 14y agoIf you've ever been involved in producing content management systems for non-technical users (typically involving TinyMCE/CKEditor etc etc) then you'll probably welcome this as much as I do. Dodgy HTML, content pasted in from Word (with crazy styling intact), and a general encouragement for users to see text content in terms of styling rather than structure are all things that it will be delightful to see the end of.
- madrona 14y agoMultiline support, please.
- ChuckMcM 14y agoThis would be so freakin' great. Would especially love a couple of the github things in there like '''lang that would totally be awesome.
- bmuon 14y agoThis illustrates the need for the Markdown language to be open to extensions. For instance I'd like to write TeX blocks that render to MathML.
- starpilot 14y agoIt'd be nice if it Markdown was added to HN, at least for a consistent way of quoting that's better than using the code tag (which frequently cuts off text for some reason in mobile Safari).
- philh 14y ago> (which frequently cuts off text for some reason in mobile Safari). Is this just because it doesn't wrap, and mobile safari doesn't display a scrollbar? (I've never used mobile safari, but I think that's true of the Android browser.) Quoting with code blocks can be awful, but > is fine even if it's not explicitly formatted.
- thedufer 14y ago> Is this just because it doesn't wrap, and mobile safari doesn't display a scrollbar? Pretty sure that's it. OS X (Safari and Chrome, at least) does the same thing unless you have a mouse plugged in. The formatting is such that it doesn't feel like it should scroll, even in the common case of characters being cut in half. Better styling on code blocks would do wonders for this.
- StavrosK 14y agoI'm not that psyched about automatic return-based linebreaks. Everyone thinks they should use linebreaks to align their text, and the system should just ignore all single line breaks. The current behavior of Markdown solves this problem very well. I don't want the newlines I enter for non-wrapping editors to remain in the generated HTML.
- dfbrown 14y agoI agree, I am having trouble thinking of a situation where specific line break positions would be important to me in regular text that isn't covered by some other markdown structure such as code blocks or lists.
- stan_rogers 14y agoOne word: poetry. Traditional break behaviour (new para) is great between stanzas/verses; not so much between lines. (It's also the primary reason why the <br> tag still exists in HTML.)
- halostatue 14y agoThen insert the <br> tag with two spaces at the end of the line.
- stan_rogers 14y agoIt's not a matter of there being no work-around. MarkDown is meant to be as much for ease-of-use for the content creator/editor as it is to be a readable alternative text source. And HTML isn't always the desired output, so why should users have to know anything about HTML unless they're creating HTML?
- graue 14y agoIf you end a line with two spaces, the line break after it is kept. Not intuitive, sure, but it works. Perhaps an alternative "profile" could be specified that preserves all line breaks, and sites focused on poetry or song lyrics could use that profile.
- raldi 14y agoI'd also advocate for accepting reversed ()[]'s on links. In other words, let the user type: [something](http://whatever.com) or (something)[http://whatever.com] ...and have both work exactly the same. It will save a lot of trouble -- and especially when linking to a Wikipedia page whose URL contains parentheses.
- cryptoz 14y agoI've been annoyed by that on reddit for...like 6 years. "You can just escape it" people say. As if normal reddit users are gonna escape strings themselves these days.
- raldi 14y agoI once wrote a piece of software for my own use that used Markdown, and I wrote a thin preparsing layer that would allow it to do the right thing regardless of which of these I typed: [http://foo.com][text] [http://foo.com](text) (http://foo.com)[text] (http://foo.com)(text) [text][http://foo.com] (text)[http://foo.com] [text](http://foo.com) (text)(http://foo.com) I think it might even have accepted {}'s.
- mmahemoff 14y agoSomething this flexible for images would go down nicely too.
- AngryParsley 14y agoI feel your pain. Parens in links made me never forget %28 and %29. But I think your solution causes more problems than it solves. The biggest issue is that it's not backwards-compatible with current markdown. For example, in a citation following parentheses: Blah blah blah (side note)[1](http://url1). Your markdown generator could output <a href="1">side note</a>(http://url1). or (side note)<a href="http://url1>1</a>. The latter is current behavior, but your suggestion makes the grammar ambiguous. Most parsers are "greedy", so the former is more likely to be output. Unless you specified more complex behavior, people would have to go back and escape their parens near links.
- DanBC 14y agoPlease please use <> to delimit URLs instead of (). This is an [example link]<http://www.example.com/> http://www.example.com/>
- phreakhead 14y agoThis would completely defeat one of the best parts of markdown, which is the ability to mix in HTML tags whenever you want, when you need to represent something more complex.
- X-Istence 14y agoI might be the only one, but I actually prefer Markdowns handling of a single "enter" without spaces at the end to mean that the paragraph is not finished. It makes writing blogs and various other stuff in Vim much simpler, and I can more easily reformat text to wrap at 80 characters, and have better control over it. Could I soft-wrap in my editor? Sure, but that would mean that the text files sitting on my hard drive now have very long strings in them making it harder to grep, making it harder to add to git (change a single character, entire line is now a diff :-(). I hope that doesn't become the default.
- jomar 14y agoI guess there is a distinction between * people typing markdown in text files, where you want to split paragraphs into word-wrapped lines of a sensible length, and consecutive non-blank lines form paragraphs just as they always have in text files; * and people typing markdown into text entry boxes on web pages, where you would like pressing the <enter> key to actually mean something. These two situations probably prefer a different default.
- X-Istence 14y agoThen make the form that the user enters data into be either parsed differently, by pre-processing it, or have some javascript magic that automatically adds the extra two spaces required to make it work. This way if the user presses <Enter><Enter> then the JS can remove the extra two spaces and it will still be valid markdown.
- pjscott 14y agoBelieve me, you're not the only one who prefers this behavior. It makes working with hard-wrapped text a hell of a lot easier.
- RegEx 14y agoI agree completely. Visually highlighting a paragraph that went a bit too wide and cleaning it up with 'gq' makes me a happy camper.
- _pdeschen 14y agoA BNF grammar would be nice to start with. IMHO, pandoc markdown support is the mother of all implement featuring lots of goodies (table and footnote to name 2)
- swah 14y agoI convinced my team to use pandoc instead of Word for documenting a new project, and now, because creating tables is so hard (they are not like Emacs users), I'm considering lobbying them back to Word, or writing a preprocessor to insert tables from CSV files... feels bad man.
- _pdeschen 14y agohttps://raw.github.com/gist/3956665/d549ea53817335c868e750ca6a29ee20b958eec1/Table.md https://raw.github.com/gist/3956665/d549ea53817335c868e750ca... How can this be harder than creating table with Word? Word always gets in the way. Word appears to be easier but down the road, it always end up as a painful process. For me just the benefit of being mergable and delegating styling at the end of the tool chain is just plain great. http://johnmacfarlane.net/pandoc/README.html#tables http://johnmacfarlane.net/pandoc/README.html#tables Edit: rendering issues!
- swah 14y agoWell, add a last row with the first column larger than the previous rows, assume people don't know about column-mode editing, and you can imagine what they are doing to align... I think I'll just "preprocess" the file, looking for something like !csvtable(filename.csv).
- swah 14y ago--- End of the story --- Wrote the script (it worked), but some specific complex features from Word still were missed ("how do I do a reference to a picture?") and couldn't be easily supported by pandoc or this script. Though for a brief time of going full-mode procrastinator and writing another markup language... Then I had to admit the whole thing wasn't really working and now recommend we move back to Microsoft Word because it's easier. A day of Total fail, and procrastination, and making everyone install MikTex, pandoc and Python. I hope I don't regret for suggesting we use Git...
- dysoco 14y agoAs a non-web developer I cry every time I need to use HTML: It's really "ugly" in some way (And I'm used to ugly languages). But I have learned to love Markdown too, I hope in the future, distant future: Someone will create a language that integrates HTML and CSS into a nice Markdown-like language.
- Evbn 14y agoNo way. Markdown chooses simplicity over correctness. Fine for chat forums an Readmes, but in many cases correctness matters.
- TazeTSchnitzel 14y agoHTML ugly? Nonsense. <!doctype html> <meta charset=utf-8> <title>Hello, world</title> <h1>Hello, world</h1> <p>This is a paragraph about HTML. <ul> <li>Bullet point <li>Bullet point </ul> That's not ugly.
- randomchars 14y agoWait, not closing <p> and <li> is valid?
- TazeTSchnitzel 14y agoCompletely. You can, with a doctype, also omit <html>, <head> and <body>, too. Not closing <li> is good, but I'd avoid it for <p>.
- wreel 14y agoI found that I've moved on to reStructuredText. It doesn't seem to be marketed as much as Markdown (the only reason I know about it is because of Sphinx) but I feel that it's a bit more capable. Simple tables are exceptionally easy and it handles URLs with parens in it just fine (a common pain when trying to link to Wikipedia articles with Markdown).
- rogerbinns 14y agoI use rst for everything due to using Sphinx heavily. Trivial tables are easy in any markup, but non-trivial ones are a pain. I use table mode in emacs, but we can't require everyone to use emacs. I hate its URL handling. And of course it needed Sphinx to make it work across more than one source file which means we now have two dialects. I do wish everyone would just agree on one syntax and be done with it.
- bookweevil 14y agoHave you tried using the list-table directive? I find it's a much easier way to create tables - it's based on writing indented lists which mirror the logical structure of the table (i.e., table / row / cell), rather than trying to produce ASCII art.
- rogerbinns 14y agoIt isn't listed in the Sphinx doc http://sphinx.pocoo.org/rest.html#tables http://sphinx.pocoo.org/rest.html#tables - and it points to rst doc only showing those two as well http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#tables http://docutils.sourceforge.net/docs/ref/rst/restructuredtex... All my doc is in Sphinx so I play it safe, and all directives need to be supported in whatever version of docutils and rst2pdf are installed across the various developer machines. So for the moment I am stuck with ascii art.
- tadhg 14y agoRegarding the URL handling, I also used to hate it, but wrote a tool to make it easier to deal with; details are here if you're interested (despite the title, the relevant tool is not Vim-only): <http://tadhg.com/wp/2012/10/07/tools-for-writing-restructuredtext-in-vim/#restructuredtext-references> http://tadhg.com/wp/2012/10/07/tools-for-writing-restructure...;
- dhaivatpandya 14y agoI love Markdown, and, this is an awesome effort! I'm working on a Markdown editor/platform that could really benefit if this sort of stuff wasn't so fragmented: http://www.nimblenot.es/ http://www.nimblenot.es/ (yes, that was a shameless plug)
- deleted 14y ago[deleted]
- ddlatham 14y agoIf everyone gets on board, great. If only a couple sites band together, then I see it more like this: http://xkcd.com/927/ http://xkcd.com/927/
- twodayslate 14y agoWhat is wrong with bbcode? All the forums use it. Why are there so many alternatives for these things?
- Bockit 14y agoTo quote from the source[1]: > The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible. The idea is that a Markdown-formatted document should be publishable as-is, as plain text, without looking like it’s been marked up with tags or formatting instructions Which is appealing to me, and many others I suspect. [1]: http://daringfireball.net/projects/markdown/ http://daringfireball.net/projects/markdown/
- citricsquid 14y agoI manage a large forum and we use BBCode. I recently "open sourced" our rules (https://github.com/minecraftforum/rules https://github.com/minecraftforum/rules) and during building the system you see there I made the decision to opt to use Markdown over BBCode -- what everyone that uses the forum is used to. BBCode isn't inherently "bad" if you're just writing something and won't ever edit it again but for anything that you will need to edit / review in the future it can be a serious pain in the ass to look through. These are the two examples I used: ### Title here This is some text [with a url](http://google.com) vs. [size=6][font=arial, helvetica, sans-serif]Title here[/font][/size] This is some text [url="http://google.com"]with a url[/url] BBCode was written to be written, it's no more difficult to write [url=http://google.com]google[/url] than it is to write: [google](http://google.com) but when reading the source (for maintaining) it... sucks, because it feels un-natural. With the Markdown version of linking (to pick a basic example) you can read a sentence how the person reading the processed version would read it: A search engine called [google](http://google.com) That reads as "A search engine called google" and then you see that google is a hyperlink. With BBCode it would read: A search engine called [url=http://google.com]google[/url] So first you read "A search engine called" then you see it's a URL and then you see "google". It can get very frustrating when you're looking at huge swathes of text written in a similar style.
- 14y ago
- blasdel 14y agoJohn Gruber's original Markdown.pl is one of the worst small programs I have ever read, completely riddled with outright bugs and misfeatures that continually bite its users in the ass. It's awful even by the already low standards of hand-written many-pass regex-based spaghetti-parsers. Nobody should be using the original script, and unfortunately many of the other implementations out there are direct transliterations that replicate all of its absurd errors, like where if you mention the MD5 hash of another token in the document, the hash will be replaced with the token, because it uses that as an inline escaping mechanism! Reddit got hit with a XSS virus that got through their filters because of it: http://blog.reddit.com/2009/09/we-had-some-bugs-and-it-hurt-us.html http://blog.reddit.com/2009/09/we-had-some-bugs-and-it-hurt-... See the changelog for what started as a PHP transliteration and turned into a rewrite that squashed 125 (!) unacknowledged bugs: http://michelf.com/projects/php-markdown/ http://michelf.com/projects/php-markdown/ The worst part is that he outright refuses to either disclaim or fix his implementation, and so far he's repudiated everyone else's attempts to do so. He's a terrible programmer and a worse maintainer, he really still thinks the documentation on his site is comprehensive and canonical. As much as Jeff Atwood leaps at every chance to play the fool, there's no way his directorship can be anything but an improvement.
- atacrawl 14y agoGet over yourself. The guy wrote something that suited his own needs and released it so that others could use it too if they wanted. Programmers ported it to other languages because they liked the idea and wanted to see it thrive -- I've used the PHP port in many homespun web apps over the years. Is it perfect? No, and no software is. But when I've needed a script that easily converts line breaks and hyphens into paragraphs and unordered lists (the normal use case I've taken advantage of), it's done the job every time.
- acuozzo 14y ago> Is it perfect? No, and no software is. You may want to look into seL4. (If you consider formal verification to be perfection, that is.)
- cdmoyer 14y ago
- SeoxyS 14y agoI'm the author of a Markdown text (prose) editor[1], and can attest to Jeff's statement that all Markdown's parsers suck. The official perl regex-based implementation is a joke. Sundown is great, but only works for cross-compilation to other markup languages; it doesn't work for syntax highlighting, which is what I'm more interested in. I ended up writing my own in Objective-C. It's not very pretty, and it doesn't use a formal grammar (just a lexer + custom grammar code), but it does the trick. I took a few liberties with the spec: throwing in GitHub-flavored code blocks. https://gist.github.com/29dabe4b6e762ee221df https://gist.github.com/29dabe4b6e762ee221df [1]: http://getmacchiato.com/ http://getmacchiato.com/
- naner 14y agoDid you know of Discount[1]? Reddit switched to that from markdown.py a couple years ago. It is written in C and BSD licensed. 1: http://www.pell.portland.or.us/~orc/Code/discount/ http://www.pell.portland.or.us/~orc/Code/discount/
- Evbn 14y agoI fixed a bug in discount-for-Reddit once. It is some of the cryptic C one sees.
- spartango 14y agoYour editor looks pretty nice; super simple with a gentle element of WYSIWYG. Can you not tile the background on the homepage, though? It looks horrendous at high resolutions and I suspect you didn't mean for it to be that way: http://cl.ly/image/341C0s1s0M03 http://cl.ly/image/341C0s1s0M03 (Safari 6.0, OS X 10.8.2)
- SeoxyS 14y agoWoah, how massive is your screen? You're totally right though, it looks awful tiled. I'll have to take care of that. By the way everybody, I'm working on version 2.0 which is just about a million times better than the original. Hit me up if you'd like to get beta builds and a free copy.
- antidaily 14y agoI can't be the only one who loathes Markdown.
- citricsquid 14y agoWhat's the reasoning behind your loathing?
- ScottBurson 14y agoI can't speculate on antidaily's reasoning, but I can tell you why I don't like this way of doing markup. (I thought I was the last one.) First is the lack of standardization. Asterisks traditionally meant boldface, I thought, but in some of these systems they mean italics. Some use underscores for italics, while others use slashes. And those are just the common conventions; the less frequently used ones tend to be even less standardized. Second is the fact that the more conventions these languages implement, the more likely I am to emit one unintentionally, and then have to figure out how to escape the input so it's treated literally, if the language even supports that. (Note for instance the long-standing Lisp convention of putting asterisks around special variable names.) Thirdly, the syntax rules of these languages are often ill-specified and incorrectly implemented, making it difficult to tell at times how to get the effect I want. EDITED to add: if you're wondering what I would suggest as an alternative to Markdown-style markup, this is an example of the kind of thing I prefer: http://nbsp.io/development/doccy-a-mid-weight-markup-language http://nbsp.io/development/doccy-a-mid-weight-markup-languag... The syntax is uniform, but much easier to type than bare HTML.
- dpark 14y agoOff the top of my head: * Links with parentheses often break * Intra-word underscores have to be escaped * Links are backwards (text,link instead of link,text like HTML anchors) * Link syntax is pretty arbitrary (why braces and brackets?) * Single line breaks are swallowed unless you append two spaces to the line. (How is this a "natural" formatting?) * Footnotes with asterisks turn into bullet lists Most or all of these are resolved by various implementations, but that's just another reason to hate Markdown: the inconsistencies between implementations.
- MatthewPhillips 14y agoThis is one of the reasons I've never bought into the Markdown hype and generally avoid using it. Semantic HTML5 tags makes to-HTML compiled languages mostly unnecessary.
- halostatue 14y ago…if you're a geek. Most people don't need to or want to think about it. Markdown is easily understandable by my wife (and we're using it to format her novels), and she doesn't have time to learn something ultimately as irrelevant to her is a format that makes a computer program happy.
- voyou 14y agoWhat is Markdown, though, if not "a format which makes a computer program happy"? Presumably, your wife was already familiar with standard typographical conventions like italics for emphasis and indents to start paragraphs. A good text processing system for a computer should let the user deal with these conventions, rather than having to learn a markup system. I'd be interested to hear why you and your wife decided to use Markdown, and what alternatives you considered and rejected.
- halostatue 14y agoThe other alternatives were essentially opaque formats (e.g., Word or Pages) that when she & I talked about them and the amount of work that I needed to do, she agreed. She also writes long hand, so this is a minor adaptation for her to write like she does with emails. The changes suggested are less natural for most people, and HTML is line noise to most people. If she had to learn HTML, my wife could do so—but it isn't necessary for her to learn HTML. It's also easier for me to have to worry about clean-up than her to do so. We do have points where we have to figure out how to make certain things work (when she has lyrics, that requires a little more massaging on my part—but I insert the bafflegab bit and she just knows to edit around it or inside it). It isn't perfect, but the results look very good. (In fact, the second novel looks better than the first, which was laid out in Pages and took me three times as long as learning LaTeX to format the second novel. The only problem with the second novel was finding a good font for the PDF version we use as a print-ready copy.)
- dfc 14y agoI really hope that they borrow a lot if not everything from pandoc[1]. My only real complaint with pandoc is the table formatting, but I think fiddlosopher is adding org-mode like table support. If you have not taken a pandoc for a spin I highly recommend you do so soon. In addition to being a great markdown dialect the pandoc tool set is the swiss army knife of text formatting. It is amazing how many formats pandoc can read and/or write. [1] http://johnmacfarlane.net/pandoc/README.html http://johnmacfarlane.net/pandoc/README.html EDIT: I spoke too soon, Fiddlosopher continues to impress. I just checked the open issues and a little less than a month ago he added "limited org-table support." Based off of the rest of pandoc "limited" probably means something like 85% to 95% :) https://github.com/jgm/pandoc/issues/519 https://github.com/jgm/pandoc/issues/519
- NullSet 14y agoI cannot second this enough. Pandoc Markdown has some nice little tidbits, oddly contrasting to the above, the table syntaxes(yes there are more than one) are pretty darn useful.
- engtech 14y agoFrom the comments on the blog: "I'm reminded of the guy who decides that there should be one standard because there are n divergent implementations. So he goes and writes his own. Now there are n+1 divergent implementations." That is probably the most likely outcome, but kudos to Jeff for trying. The idea of Markdown is great, but I found the implementation of links is less than obvious. (haven't tried it in 4 years, so there was probably other issues that I had that I've forgotten) The problem I inherently always end up having with "parses to HTML" syntax conventions is there are always warts where the syntax is harder to remember than the HTML it is supposed to parse to.
- raganwald 14y agoThis guy? http://xkcd.com/927/ http://xkcd.com/927/
- fusiongyro 14y agoYou can hardly blame links for that. There was no widespread hypertext format before HTML for conventional renderings to appear in. Most of the rest of Markdown has analogues in earlier plain text formats and is fairly visually suggestive. Common Lisp managed to unite several divergent implementations of Lisp (MacLisp, InterLisp, Lisp Machine Lisp, etc.) under a single common specification. This was possible because the Common Lisp standard was not created by some third-party out of dissatisfaction with the other guy's stuff but by significant representatives from all the big camps. The desire was for better interoperability, not imposing ideals on the competition. I think this effort, if Gruber supports it, is likely to succeed simply by incorporating most of the community. In fact, it could be even easier, because one of the principle motivators for the divergent implementations of Markdown is simply to create concrete specs around a concrete grammar. This doesn't mean there won't be divergences (Scheme, Clojure, OpenLisp, etc.) it just means that those divergences will be principled ("we reject the size", "we desire modern FP techniques") rather than accidental ("we used this regex instead of that to tokenize emphasized text").
- zrail 14y ago(shameless plug) I wrapped Pandoc[1] in a web service and added on nice PDF exports and called it Docverter[2]. It will convert basically anything plain-text, including Markdown, into almost anything else plaintext, HTML, RTF or Docx. I also added rich PDF exports that go through a HTML intermediary. If this gains some traction I'm sure I'll be adding support for it at some point. [1]: a wonderful almost-everything-to-everything text converter http://johnmacfarlane.net/pandoc/ http://johnmacfarlane.net/pandoc/ [2]: http://www.docverter.com http://www.docverter.com
- christiangenco 14y agoWhy not just move to Pandoc[1]? 1. http://johnmacfarlane.net/pandoc/ http://johnmacfarlane.net/pandoc/
- Ingaz 14y agoWhy not just move to docutils?
- juliangamble 14y agoWhat is the canonical implementation of markdown? > The problem with writing my own Markdown parser in Clojure is that Markdown is not a well-specified language. There is no "official" grammar, just an informal "Here's how it works" description and a really ugly reference implementation in Perl. http://briancarper.net/blog/415/ http://briancarper.net/blog/415/ http://stackoverflow.com/questions/7307480/what-is-the-canonical-implementation-of-markdown http://stackoverflow.com/questions/7307480/what-is-the-canon...
- dgreensp 14y agoWow, I wasn't expecting my email to Jeff to end up as a front-page blog post! The point here is that Markdown doesn't have a spec, nor do any of its variants to my knowledge, so I was proposing to come up with some Markdown-like language that does have a spec. Under discussion here is the more ambitious (but also appealing) plan of writing an official spec for Markdown, the same way JavaScript got a spec in the form of ECMAScript that we now identify with JavaScript itself. A spec is a long, tedious, human-readable document that explains the behavior of a system in unambiguous terms. Specs are important because they allow us to reason about a language like Markdown without reference to any particular implementation, and they allow people to write implementations (Markdown processors) independently that behave identically. The Markdown Syntax Documentation is not a spec (it's highly ambiguous), nor is any implementation (not human-readable; some behaviors are probably accidental or incidental and difficult to port perfectly). The hard part of writing a spec is codifying the details in English, and secondarily making decisions about what should happen in otherwise ambiguous or undefined cases. My motivation for working on a Markdown spec is first and foremost avoiding "bit rot" of content, which happens when we write content against one Markdown implementation and then later process it with another. We don't have this concern with HTML, JSON, or JavaScript, or at least we know what bounds to stay within to write code that will work on any implementation. This is achieved through specs, even if only implementers ever read them. I would love pointers to Markdown processors that are implemented in a more principled way than the original code, for example using standard-looking lexing and parsing passes, but that still handle nested blockquotes and bullet lists together with hard-wrapped paragraphs.
- halostatue 14y agohttps://github.com/jgm/peg-markdown https://github.com/jgm/peg-markdown and https://github.com/fletcher/peg-multimarkdown https://github.com/fletcher/peg-multimarkdown I haven't looked at the implementations of these, but they are most certainly grammar-based, not regex-based.
- eslaught 14y agoYou should look at Pandoc[1]. It's a Markdown-to-everything converter, and though I'm not super familiar with the code I believe it's well written. One of my favorite tools for writing. [1]: http://johnmacfarlane.net/pandoc/ http://johnmacfarlane.net/pandoc/
- nickpresta 14y agoI really like the Mou text editor for Markdown: http://mouapp.com/ http://mouapp.com/ Mou + the (built in) Github theme = best Markdown editing experience.
- jiyinyiyong 14y agoRead this if you use Markdown alongwith Chinese: http://ruby-china.org/topics/6335 http://ruby-china.org/topics/6335
- eob 14y agoAs a heavy LaTeX user (phd student; can't escape it), I'm convinced that there is a small enough subset of LaTeX that actually gets used day-to-day that someone could figure out a way to shim it into something like Markdown. And then, for the LaTeX that you can't shim in, just have some escape hatch that sends fragments out to a renderer. If I could only have: * Math mode * Citations and Bib files * Labels and References Then I'd be willing to go through a lot of extra pain to get all the weird tables and precise image placements that are inevitable in a 2-column ACM format. EDIT: Having just investigated Pandoc, which many here are talking about, I realize this might be exactly what I've been looking for :)
- bookweevil 14y agoHave you tried reStructuredText? rst2latex has worked very well for me. The current version has math mode. I've occasionally had to write some custom LaTeX to get things like natbib to work, but it's largely been problem-free.
- jlongster 14y agoI'm excited about this too. I just wrote a blogging engine for node that allows you to edit posts in a web-based editor: http://jlongster.com/edit/Introducing-Nunjucks,-a-Better-Javascript-Templating-System?redirected=true http://jlongster.com/edit/Introducing-Nunjucks,-a-Better-Jav... I absolutely love the simplicity of Markdown, especially with github's addition of code fences/blocks. It's so trival now to add code and have it automatically highlighted. It's not nearly that simple in other formats (to get autohighlighting I guess). Excited to see what will come of this.
- uvtc 14y agoSomewhat related: Pandoc supports delimited ("fenced") blocks as well, but as an alternative allows you to use tildes ~~~python print "hi" ~~~ rather than backticks ```python print "hi" ``` My own 2 cents: I like the more symmetrical tildes. Anyhow though, yes, I agree; it's great that github supports delimited/fenced syntax-highlighted code blocks and renders .md files there automatically.
- tomjen3 14y agoThat site is broken on my android phone in chrome. Each time I scroll it moves back. WTF
- jlongster 14y agoIt's probably the Ace Editor. Not really built for mobile phones.
- kaptain 14y agoWhy? Why get all angry at John Gruber? As many have already noted, he created Markdown for himself and released so that others could use it. AFAIK he didn't put any license/restrictions on it outside of calling himself BDFL. Whatever his skills as a programmer, writer, or his role as Mouthpiece of Apple, the vitriol is unnecessary (but absolutely fanscinating to watch). My panties bunch up naturally, no need to allow my feelings regarding Gruber to bunch them further. Why get his approval? In the same spirit that Gruber created something for himself, you should just create something for yourself. I find it hard to believe that Gruber was the first person that conceived the idea of user-friendly text-markup. The new standard could just be inspired by Markdown and that would be a win-win: a respectful nod towards Gruber as well as the ability to move towards something 'better'.
- fusiongyro 14y agoIt's consensus-building. If the creator of Markdown says the successor technology is Rockdown, everybody who deploys something on Markdown will get hate mail: "why aren't you using Rockdown? Gruber says it's the future." If that doesn't happen, Rockdown is just a peer to Markdown—an improved, specified peer but not anointed. It leaves the window open for people to say, "well, I like flavor-X Markdown better than Rockdown, so that's what I use."
- kaptain 14y agoIf consensus-building is one of the goals, then I would agree with you that Gruber's blessing is important. But one of the goals of Markdown is to provided easy-to-use markup for text. Whatever the next iteration of this looks like, I think that people will get on board if it provides a clear advantage over Markdown as it exists as well as other markup formats. With or without Our Dear BDFL's blessing. Only geeks will complain about whether the successor of Markdown is deployed. Others, the majority of whom user-friendly markup is aimed at, won't care. If enough people get behind this, it won't matter that Rockdown is a peer to Markdown. With good tools and support, Rockdown has the potential to exceed Markdown, even if it's just providing a better canonical parser and documentation since it's pretty clear from most of these comments that this is where Markdown is lacking.
- DannoHung 14y agoALIGNMENT SYNTAX
- kickingvegas 14y agoSo, pulling an old man card: creating a formal spec for Markdown paves the way for adding more syntax which negates the main benefit of it: a lay person can interpret Markdown as a text file. If you want to add more syntax, we are better off using/extending LaTeX or troff.
- adam-p 14y agoAnd if you like Markdown... I wrote a Chrome/Firefox/Thunderbird extension that lets you write email in MD and then render it before sending: https://github.com/adam-p/markdown-here https://github.com/adam-p/markdown-here Enjoy.
- happypeter 14y agoMarkdown is really a important part of my life now, YES, it will be super cool that the world can have one single spec for it.
- lmm 14y agoAll three of the "gotcha" changes suggested here are wrong, and changing them would kill what makes markdown great. The one change for good I can think of would be removing the ability to embed HTML.
- nkwiatek 14y agoI'm not a huge fan of the current Markdown mark. I'd encourage the creator (dcurtis) to push it, because currently it feels like a first-stage idea — or perhaps, an execution without an idea at all. There are many questions — "What is Markdown?", for starters — that feel unaddressed by the mark. Instead, we get the brute force approach: splitting up the word into smaller word parts, which is what you do with a word if you don't know what it means, or you have to gesture it in Charades. Rather uninspiring for an idea so beautiful that Jeff and others can get so excited just thinking about it, but what else can you expect from such a mark whose approach is so stubbornly literal? I take that back — only one word part actually gets to be represented literally... the other only managed to become a letter, in a moment I can only imagine involved the creator muttering "good enough". He must have found this mark uninspiring as well, given that he sought to put a box around it. At least consider that the down arrow on its own is an overloaded concept, particularly on the web. Without context — and a mark should not need context — M↓ could read like a hotkey or command of some kind. This kind of ambiguity is utterly unnecessary — you're making a mark; it can be whatever you want it to be. Push!
- olalonde 14y agoWhat I really miss in Gruber's markdown is a way to hint syntax highlighting. For example, on Github: ```javascript alert('woohoo'); ```
- bergie 14y agoThere was some discussion about allowing even more metadata than just the syntax highlighting hint for fenced code blocks in the Literate CoffeeScript thread: https://news.ycombinator.com/item?id=4608165 https://news.ycombinator.com/item?id=4608165
- TeMPOraL 14y agoSomebody please make a web-usable of Org Mode the language; it's like Markdown, but older, richer in features (while being as simple as Markdown) and is in daily use by many hackers for note taking, outlining, TODOs, organizing your life, etc. I'm very happy that GitHub has an Org Mode renderer, even if rudimentary - I don't have to rewrite my notes and READMEs to Markdown.
- unimpressive 14y ago> I'm very happy that GitHub has an Org Mode renderer, even if rudimentary - I don't have to rewrite my notes and READMEs to Markdown. For that situation, wouldn't a org mode to markdown converter be more useful?
- ianstormtaylor 14y agoIt has always bothered me that _text_ is not underlined text, but italicized text. Why not /text/ for italicized text. It shows exactly what it is doing. And text for bold text. I also see no reason for text and _text_ to produce the same output. It just seems like a fault in the original spec to me.
- debacle 14y agoIt's a carry-over from long before I started using the Internet (1995?), and I've heard was an artifact of typesetting.
- uvtc 14y agoI think the reasons for those choices are: * It's very uncommon to want your output text actually underlined. * If you really do want underlining, just use <u>this</u>, since it's fine to put raw html in Markdown source. * The most common way folks express emphasis is probably with ✱asterisks✱ (HN won't let me backslash-escape the *). A less-common alternative is to use _underscores_ (though I rarely see that anymore these days). Maybe the distant third most-common way was with /slashes/. I guess Gruber had to draw the line somewhere and just support the first two most common ways to write it. That seems reasonable. Another reason to not use slashes for emphasis: using them might interfere (or at least cause headaches) with writing directory names, fractions 1/2, and "and/or" wordings.
- matthiasv 14y agoIt's been part of email and newsgroup etiquette for ages now. Same goes for the quote blocks. So, why change something that is working for a lot of people in different domains?
- TazeTSchnitzel 14y agoOK. But please fix one thing first: 1. hello something 2. foobar Should not render as: 1. hello something 1. foobar There's the start= attribute for <ol>, at least use it!
- jacobr 14y agoIn a comment area (like on HN) it rarely makes sense to be able to add headings. Could some features of the specification be optional, so that a parser can be conforming even if it disabled those features? Are there any parsers (preferably in JavaScript) which currently let you toggle features like that?
- lorenzfx 14y agowhat I really miss from markdown (and even more from reStructuredText because I actually use it a lot) is strikethrough (which github does support)
- uvtc 14y agoFYI, Pandoc uses ~~two tildes~~ for strikeout syntax.
- alexchamberlain 14y agoAn effort appears to have been started on http://markdown.github.com/ http://markdown.github.com/.
- Tloewald 14y agoIf it were up to me, I'd simply ask that markdown add support for h3 (other than hashes, e.g. Underline with hyphen and spaces) -- two levels of headings is all too frequently insufficient, inline links to images be rendered as image tags, inline links to videos etc. likewise become video tags, etc., the way other inline links become anchor links, and some form of table support be standardized. Aside from that (and implementation bugs) I've been very happy with markdown.
- WickyNilliams 14y agoYou can have any number of heading levels. Instead of Doing this: Heading 1 ========= Heading 2 --------- Do this: #Heading 1 ##Heading 2 ###Heading 3 ####Etc. Edit: formatting
- Tloewald 14y agoI know about hashes -- read my post.
- uvtc 14y agoUsing Pandoc, what my habit has become is have the first line at the top of the file be title metadata: % Title Goes Here then make subsequent headings go ahead and start at h1 (rather than h2): Some h1 ======= This puts an `<h1 class="title">Title</h1>` at the top, with regular unadorned h1's further down the page. So, if you like, you can style the title h1 differently from the other h1's. It breaks the soft rule of having only one h1 on a page, but otoh looks good, and doesn't require me to go to h4 or h5 very often, so I can live with it. :)
- kibwen 14y agoHow would one go about taking a project with a large corpus of non-standard markdown (e.g. Github, Reddit) and converting it to any standardized form, assuming that a standard is chosen that is not 100% backwards-compatible with all existing markdown flavors? I don't think such a thing is feasible. I also don't think it's feasible for any proposed standard to simply look at the largest users and say "okay, we'll accept the idiosyncratic extensions of all of these differing flavors in an unambiguous way." So assuming this pushes forward, there are (to my mind) two possible outcomes: 1) A backwards-incompatible standard emerges. No existing project adopts it, but new projects do. It gains legitimacy only once Github, Reddit, et al fade into obscurity. 2) A backwards-compatible standard emerges. Every large existing project adopts it, but the standard is so full of cruft and TIMTOWTDI that in ten years it gets usurped entirely by a challenger that emphasizes simplicity.
- vilhelm_s 14y agoFor Reddit, I would use the new parser for comments written after the upgrade and the old parser for comments written before the upgrade. Note that Reddit already puts post that are older then a month or so into a "frozen" archive mode where they can not be further modified, so after a month the old parser could be thrown away completely. Not sure what to do about Github.
- zeitg3ist 14y agoDidn't Gruber co-design Markdown with Aaron Swartz[1][2]? Is there any reason why everyone refers to Gruber as Markdown's sole inventor/BDFL? What's Swartz opinion on all this? [1] http://www.aaronsw.com/weblog/001189 http://www.aaronsw.com/weblog/001189 [2] http://en.wikipedia.org/wiki/Markdown http://en.wikipedia.org/wiki/Markdown
- blackstag 14y agoI love markdown. I even created my own version which I have become addicted to -> http://blackstag.com/markdown http://blackstag.com/markdown. I'm fairly confident I will be the only one to appreciate my personal version, but hey - It's the ugly child I have come to love. I'd certainly be interested in switching over to their version, provided some of the noted kinks get worked out.
- jeffio 14y agoWe recently added Markdown as an option in our hosted reseller CMS (YikeSite) in hopes that some of our customers would choose it over the WYSIWYG editor. You can play with it here: http://www.markdowncms.com http://www.markdowncms.com If there was a standardized Markdown, we would implement that for sure.
- antirez 14y agoI love Markdown, and I hate Markdown. I love it because the world needs an easy-for-humans way to format in pure ASCII without any tool. It is much simpler than using even the most well designed GUI. You can even write books with it, and you can focus on content. But I hate Markdown. I hate it because it is superficially good: a lot of Markdown seems to make sense at a first glance, but if you look at it more closely you see that a lot is broken in its design (IMHO the fact that the reference implementation is broken is the minor of the issues). It is surely possible to fix it. However it's better to have a broken Markdown now that no markdown at all. The fact that Github and Stack Overflow and Reddit are using it makes it absolutely obvious how useful and great the concept is. The actual design, implementation, and specifications can be fixed now. So kudos to the original inventor, but it needs a second pass from people that can give it a more coherent shape, with clear behavior, minor surprise, and parsing in mind.
- blacksmythe 14y agoMarkdown is fantastic as a first draft of something, when you want to focus almost solely on content. For subsequent revisions, it makes far less difference to me what format the text is in. (edit: for that reason any deficiencies in Markdown don't bother me)
- buster 14y agoIs there a reason why i should prefer Markdown over restructuredText? rst sems to me has all i need, it has specs, it has decent documentation, it has tools, it's not only used to output HTML but all kinds of stuff. rst just looks more powerful and yet still as readable as markdown.
- gthank 14y agoHaving used them both a fair bit (though not to write novels, like some of the people on here): Markdown source is prettier to look at. This might seem minor, but it's the primary goal of Markdown. If I'm writing something highly technical, I prefer RST; if I'm writing something closer to plain English, I prefer Markdown.
- donnfelker 14y agoMore Atwood link bait.
- saosebastiao 14y agoPlease, please, please include a specification for table creation
- Ingaz 14y agodocutils have this
- variedthoughts 14y agoI just like that there is a discussion going on. I'd like a spec. And one that can grow