allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [6/7] allura git commit: [#6923] Add emoji support for commit messages
Date Tue, 23 Oct 2018 20:11:09 GMT
[#6923] Add emoji support for commit messages


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/09c04d96
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/09c04d96
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/09c04d96

Branch: refs/heads/master
Commit: 09c04d96c8784d8ec3c6b4c5aff6216b87a0be89
Parents: bebfa23
Author: Shalitha Suranga <shalithasuranga@gmail.com>
Authored: Tue Oct 23 12:00:58 2018 +0530
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Tue Oct 23 19:56:51 2018 +0000

----------------------------------------------------------------------
 Allura/allura/lib/app_globals.py         | 2 +-
 Allura/allura/lib/markdown_extensions.py | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/09c04d96/Allura/allura/lib/app_globals.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/app_globals.py b/Allura/allura/lib/app_globals.py
index 8958558..ddcfa14 100644
--- a/Allura/allura/lib/app_globals.py
+++ b/Allura/allura/lib/app_globals.py
@@ -442,7 +442,7 @@ class Globals(object):
 
         """
         app = getattr(c, 'app', None)
-        return ForgeMarkdown(extensions=[CommitMessageExtension(app), 'nl2br'],
+        return ForgeMarkdown(extensions=[CommitMessageExtension(app), EmojiExtension(), 'nl2br'],
                              output_format='html4')
 
     @property

http://git-wip-us.apache.org/repos/asf/allura/blob/09c04d96/Allura/allura/lib/markdown_extensions.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/markdown_extensions.py b/Allura/allura/lib/markdown_extensions.py
index ef5258b..d025590 100644
--- a/Allura/allura/lib/markdown_extensions.py
+++ b/Allura/allura/lib/markdown_extensions.py
@@ -284,8 +284,7 @@ class EmojiExtension(markdown.Extension):
         markdown.Extension.__init__(self)
         
     def extendMarkdown(self, md, md_globals):
-        pattern = EmojiInlinePattern(self.EMOJI_RE)
-        md.inlinePatterns.add('emoji', pattern,'<not_strong')
+        md.inlinePatterns["emoji"] = EmojiInlinePattern(self.EMOJI_RE)
 
         
 class EmojiInlinePattern(markdown.inlinepatterns.Pattern):


Mime
View raw message