Support !avatar syntax in bugdown.

(imported from commit 72551c5df96f5b383d3593c9618cc82413d5d95d)
This commit is contained in:
Steve Howell 2013-11-12 17:48:05 -05:00
parent 2086ee8979
commit 761c0a0266
1 changed files with 3 additions and 0 deletions

View File

@ -658,7 +658,10 @@ class Bugdown(markdown.Extension):
md.parser.blockprocessors.add('ulist', UListProcessor(md.parser), '>hr') md.parser.blockprocessors.add('ulist', UListProcessor(md.parser), '>hr')
# Note that !gravatar syntax should be deprecated long term.
md.inlinePatterns.add('avatar', Avatar(r'!avatar\((?P<email>[^)]*)\)'), '_begin')
md.inlinePatterns.add('gravatar', Avatar(r'!gravatar\((?P<email>[^)]*)\)'), '_begin') md.inlinePatterns.add('gravatar', Avatar(r'!gravatar\((?P<email>[^)]*)\)'), '_begin')
md.inlinePatterns.add('usermention', UserMentionPattern(mention.find_mentions), '>backtick') md.inlinePatterns.add('usermention', UserMentionPattern(mention.find_mentions), '>backtick')
md.inlinePatterns.add('emoji', Emoji(r'(?<!\w)(?P<syntax>:[^:\s]+:)(?!\w)'), '_end') md.inlinePatterns.add('emoji', Emoji(r'(?<!\w)(?P<syntax>:[^:\s]+:)(?!\w)'), '_end')
md.inlinePatterns.add('link', AtomicLinkPattern(markdown.inlinepatterns.LINK_RE, md), '>backtick') md.inlinePatterns.add('link', AtomicLinkPattern(markdown.inlinepatterns.LINK_RE, md), '>backtick')