4 ms·
implementing a markdown parser is far from trivial implementing a parser that tricks people into believing it parses markdown because it acts like a markdown p
by kragen 3y ago
implementing a markdown parser is far from trivial
implementing a parser that tricks people into believing it parses markdown because it acts like a markdown parser in simple cases is what is trivial
it's likely that your markdown data will indeed be recoverable, but if you're generating it yourself, html is probably safer
- arnaudsm 3y agoParsing markdown is multiple orders of magnitude easier than Microsoft Word, especially before docx. And it has the merit to be human-readable in plaintext!
- kragen 3y agothat's probably true
- jprete 3y agoBut the Markdown document doesn't actually need a parser to still be usable. Markdown as a whole imitates the conventions of typed text. The table formats would even be usable on an old typewriter.
- kragen 3y agomarkdown doesn't have tables, although you can include html <table> tags in it. perhaps you mean indented fixed-width blocks you can use for ascii art or typewriter-style tables?
- kelnos 3y agoSure it does. It may not be in the original standard, but many/most parsers support tables that use pipe characters to separate columns. And regardless, markdown documents -- including the table extension -- are readable without a parser.
- kragen 3y agoextensions to markdown aren't markdown; that's why commonmark is called commonmark not being able to tell which variant of a language is in use is one of the biggest problems for archival, and in particular various extensions to the microsoft word format (all made by the same company!) were what made jgc's archival work so difficult in this case language extensions are an especially bad problem when there's no extension mechanism—because sometimes a pipe is just a pipe. but unfortunately markdown's only extension mechanism is html
- samatman 3y agoIt's called CommonMark because Gruber insisted. Not because extensions to markdown aren't Markdown®, which no one cares about, and not because it isn't markdown in the ways that matter. Ironically, his objection was to the idea of a single and rigorous standard, you'll note that Git-flavored markdown never drew his wrath. And yet you're treating him and Swartz's implementation as if it was such a standard. Which it is not.
- kragen 3y agosee https://news.ycombinator.com/item?id=39398056 https://news.ycombinator.com/item?id=39398056 for corrections
- zilti 3y agoOr org-mode format. Then you even get tables properly.
- samatman 3y agoThe (only) issue is that Markdown isn't a format, it's a loose family of formats with many extensions. Implementing a parser Commonmark is not an especially difficult task in the grand scheme of things, it's quite well specified and has an extensive test suite. Although I find myself wondering what this "parsing Markdown" business is even about. It's perfectly legible as plain text, that was the main design principle behind it. If the goal is to have your data accessible in future, if you can read it now, and you don't go blind, you'll be able to read it later as well.
- kragen 3y agoin my comment 'markdown' does refer to a format, not a loose family of formats. that is also the case in the comment to which i am replying, as clarified in https://news.ycombinator.com/item?id=39358594 https://news.ycombinator.com/item?id=39358594, and it is also the case in the comment at https://news.ycombinator.com/item?id=39363100 https://news.ycombinator.com/item?id=39363100. (https://news.ycombinator.com/item?id=39360358 https://news.ycombinator.com/item?id=39360358 is using the same divergent definition you are using, and other comments are ambiguous.) in the controversy around the release of commonmark, john gruber made it clear that his objection to the term 'standard markdown' was specifically that what he meant by 'markdown' was a specific syntax, not a loose family of formats; see https://nitter.lanterne-rouge.info/gruber/status/507651498692849665 https://nitter.lanterne-rouge.info/gruber/status/50765149869... > @twangus @s_margheim @danielpunkass They’ve done more than “formalize”. They’ve changed the syntax. New syntax, new name. That’s all I ask. you are of course free to use any word to mean whatever you like, however much it may annoy gruber; but consider that interpreting a word in a way at variance to the rest of the conversation will leave you, unnecessarily, wondering what the conversation is even about, as in this case if you want to discuss what people should mean when they say 'markdown', please leave me out of that discussion, and please do not attempt to use it to imply that my words meant something i did not intend it is true that markdown degrades gracefully, as does html. but graceful degradation is not the same thing as faithful preservation of archived documents it would of course not make sense to write a parser for a loose family of file formats, but it makes perfect sense to write a parser for a file format. as discussed extensively in the funding documents for a project we recently worked on together, this is in fact an essential activity for the faithful preservation of archived documents in that format
- inopinatus 3y agostrictly speaking, markdown is a superset of html