This is Ulric Wilfred's Typepad Profile.
Join Typepad and start following Ulric Wilfred's activity
Join Now!
Already a member? Sign In
Ulric Wilfred
Recent Activity
A thoughts regarding parsing Markdown in general and its improvements. Markdown became a geeky-language, easier version of LaTeX, reduced in functionality in favor of speed of writing. However, geeks term is not equal to mean programmers only, but also it's about designers and even literature authors. As a result, language spec may not to require all this programming-language-marks & s.o. in plain version, it should may be detect language by itself using similar-to-SO approach. Or it should not have special syntax for it, but use HTML-comments to mark a language, since they are supported everywhere (I know that there is a lack of copying code with 4 spaces before, but I think it is easily-resolvable in any modern code editor and it breaks markdown-compatibility if doing it other way than John recommended at start). And I agree, there is a huge "want" to include tasty features in Markdown, but there should be a very strict selection of such features, because it is very hard to make all of them still look lovely, so someone (like John) and only him should say "I said so and it'll be". Or, including features should be based on votes. Or, even better, the plugin-like system may save us all, if there will be a central plugin repository (say, "Markdown Flavors"), with parsers/PEG for every programming language, and it will be as easy to include one as including script tag or head-file in your document. And, of course, there should be a central distribution site, where all tests will run every second for a main implementation itself and CDN for every parser/plugin and so on... BTW, Mou is the best Markdown-editor for Mac OS for me, it parses almost all of the list-in-list-in-blockquote problems)
Toggle Commented Oct 26, 2012 on The Future of Markdown at Coding Horror
An answer both to Lilleyt and for the post, regarding technical issues of implementing it in JavaScript. I personally tried to implement PegJS-based parser for Markdown (see links below). However, PegJS-generated result looks totally huge, about 10+MB, partly because my version of parser is for sure not finished, not perfect and there are a lot of ways to optimize, but partly because PegJS by David Majda renders rules in a plain way - no operator-functions or something like that. The last fact affects speed in a good way, but it also affects parser size in a very bad way. So, while I haven't finished Markdown parser, about a year ago I've started to tune up (refactor) PegJS implementation to have a function for each operator and to improve scoping and stuff. This parser-generator may in result parse a bit slower than original, but will weight much-much less number of bytes: it is totally in minimalistic style, not-used operators are excluded, and so on. But I am still in this, writing a code in small portions, still seeing a good end, but still in progress. So, here are two facts I have for now: - It is hard to represent some complex rules of Markdown in PEG, like blockquote-in-list-followed-by-block-of-code, but is achievable, since there is a googd enough implementation in C++ by Ali Rantakari (however, it also fails in some complex variations). - Current version of PegJS is not a very good match for it, at least for now (or may be I am very wrong in a way I am impementing a parser). It will be almost impossible to include the parser in mobile applications and so on. My version of PegJS parser for Markdown, in progress: https://github.com/shamansir/mdown-parse-pegjs My customized version of PegJS, inteded to produce very compact parsers using the powers of functional code, in progress: https://github.com/shamansir/pegjs C++/PEG GUI-oriented implementation of Markdown parser: http://hasseg.org/peg-markdown-highlight/ Useful links on parsing Markdown: https://github.com/shamansir/mdown-parse-pegjs#sources MDTest to test your Markdown parse on compatibility with spec: http://git.michelf.com/mdtest/
Toggle Commented Oct 26, 2012 on The Future of Markdown at Coding Horror
Ulric Wilfred is now following The Typepad Team
Oct 26, 2012