Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Markdown is being critized because it doesn't allow markdown syntax within HTML blocks, and because the HTML vocabulary recognized isn't customizable. Both problems were basically solved by SGML over 30 years ago.

In SGML, you can define arbitrary tokens (character sequences) that the parser replaces into something else, typically into start-element or end-element tags. Replacement text rules are defined in a context-sensitive way depending on the parent element wherein token(s) to replace appear as child content. For example, an asterisk could be mapped to <i>, and within an <i> element could be mapped to </i>, terminating it, and thereby implementing a small fragment of markdown.

This, together with tag omission/inference rules on a fully custom DTD vocabulary powerful to cover HTML5, gives you quite a formidable technique for markdown customization, based on an ISO standard.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: