I am using regex in Python to pull comments, formatted with Markdown, from a CoffeeScript file. CS uses ### as the start and end markers for multiline comments. This conflicts with the markdown formatting because # is used to denote a header class. Is it be possible make Markdown interpret the % or ^ or some other character as the header class token?
Share
It is possible to override many elements of Python Markdown by taking advantage of the
markdown.extensions.Extensionclass. After a little digging and experimenting I got this to work by writing a custom header parser which extended the generic BlockParser.Essentially it looks something like this
About half way through researching this I also found another, less desirable, work around. There are two types of header styles that markdown understands Setext and atx. Setext uses ==== and —– on the line below the text to provide two header levels h1 and h2.