Extra markdown suggestions
    Yuri Takhteyev 
    qaramazov at gmail.com
       
    Fri Nov 28 20:57:25 EST 2008
    
    
  
> Another topic is about how to go about changing Michel Fortin's PHP code to
> implement these changes.  Is this the right forum to discuss such code
> changes?
In Python Markdown we've put a lot of effort precisely into making
such changes as painless as possible. For example, adding support for
/emphasis/ just requires one line in _your_ code:
    import markdown
    md = markdown.Markdown()
    md.inlinePatterns["slash_emphasis"] = \
       markdown.inlinepatterns.SimpleTagPattern(r'(\/)([^\/]*)\2', 'em')
    print md.convert("this /should/ work")
(This is for the version currently in git.  The last released version
makes it a little more complicated, though not that much more.)
- yuri
-- 
http://sputnik.freewisdom.org/
    
    
More information about the Markdown-Discuss
mailing list