diff --git a/HyperKitty-1.3.7.tar.gz b/HyperKitty-1.3.7.tar.gz
deleted file mode 100644
index 0a3d82f..0000000
--- a/HyperKitty-1.3.7.tar.gz
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:4d74aca3ec30546741ca62339ece72392e298f511d0a89e69bcedbfcdc8102cb
-size 2691781
diff --git a/HyperKitty-1.3.8.tar.gz b/HyperKitty-1.3.8.tar.gz
new file mode 100644
index 0000000..c578a74
--- /dev/null
+++ b/HyperKitty-1.3.8.tar.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8fffccadba2cfe0d4119e9c746639ee46bc0cdae67bbf99c84081d2d0bbd87b8
+size 2556166
diff --git a/fix-elasticsearch8.patch b/fix-elasticsearch8.patch
deleted file mode 100644
index 3b896da..0000000
--- a/fix-elasticsearch8.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 0e86f9cc40bf05cb819087f1fb0ee56f43968e1b Mon Sep 17 00:00:00 2001
-From: Daniel Garcia Moreno This is the response. This is the response. # This is another sample text. This is the replied text.{text}
')
-
-- def emphasis(self, marker, text):
-+ def emphasis(self, text, marker):
- """Emphasis with marker included."""
- return super().emphasis(marker + text + marker)
-
-- def strong(self, marker, text):
-+ def strong(self, text, marker):
- """Strong with marker included."""
- return super().strong(marker + text + marker)
-
-@@ -42,7 +42,7 @@ class MyRenderer(mistune.HTMLRenderer):
+@@ -42,7 +43,7 @@ class MyRenderer(mistune.HTMLRenderer):
return ''.format(
src=src, title=title, alt=alt)
- def image(self, src, alt_text, title):
-+ def image(self, alt, url, title=None):
++ def image(self, alt, src, title):
"""Render image if configured to do so.
HYPERKITTY_RENDER_INLINE_IMAGE configuration allows for
-@@ -50,25 +50,28 @@ class MyRenderer(mistune.HTMLRenderer):
+@@ -50,10 +51,10 @@ class MyRenderer(mistune.HTMLRenderer):
default since embeded images can cause problems.
"""
if getattr(settings, 'HYPERKITTY_RENDER_INLINE_IMAGE', False):
- return super().image(src, alt_text, title, )
- return self._md_style_img(src, title, alt_text)
-+ return super().image(alt, url, title)
-+ return self._md_style_img(url, title, alt)
++ return super().image(src, alt, title, )
++ return self._md_style_img(src, title, alt)
- def link(self, link, text=None, title=None):
-+ def link(self, text, url, title=None):
++ def link(self, text=None, url=None, title=None):
"""URL link renderer that truncates the length of the URL.
This only does it for the URLs that are not hyperlinks by just literal
- URLs (text=None) so text is same as URL.
+@@ -61,14 +62,14 @@ class MyRenderer(mistune.HTMLRenderer):
It also adds target=“_blank” so that the URLs open in a new tab.
"""
-- if text is None:
+ if text is None:
- text = link
-+ # text can be none of same as url in case of autolink parsing. This
-+ # will truncate the length of the URL in both cases but preserve
-+ # the actual URL destination in the hyperlink.
-+ if text is None or text == url:
+ text = url
if len(text) > 76:
- text = link[:76] + '...'
@@ -149,60 +132,22 @@ Index: HyperKitty-1.3.7/hyperkitty/lib/renderer.py
- s = '' + (text or link) + ''
-+ s += ' title="' + safe_entity(title) + '"'
+ return s + '>' + (text or url) + ''
class InlineParser(mistune.inline_parser.InlineParser):
-@@ -79,27 +82,13 @@ class InlineParser(mistune.inline_parser
- ‘emphasis’ or ‘strong’ node.
- """
-
-- def tokenize_emphasis(self, m, state):
-- marker = m.group(1)
-- text = m.group(2)
-- if len(marker) == 1:
-- return 'emphasis', marker, self.render(text, state)
-- return 'strong', marker, self.render(text, state)
--
-- # This is an override for a fix that should be in mistune.
-- # https://github.com/lepture/mistune/pull/276
-- def parse_auto_link(self, m, state):
-- if state.get('_in_link'):
-- return 'text', m.group(0)
--
-- text = m.group(1)
-- if ('@' in text and
-- not text.lower().startswith('mailto:') and
-- not text.lower().startswith('http')):
-- link = 'mailto:' + text
-- else:
-- link = text
-- return 'link', escape_url(link), text
-+ def parse_emphasis(self, m, state):
-+ end_pos = super().parse_emphasis(m, state)
-+ last_token = state.tokens[-1].copy()
-+ marker = m.group(0)
-+ last_token['attrs'] = {'marker': marker}
-+ state.tokens[-1] = last_token
-+ return end_pos
-
-
- def remove_header_rules(rules):
-@@ -112,8 +101,8 @@ def remove_header_rules(rules):
-
+@@ -113,7 +114,7 @@ def remove_header_rules(rules):
class BlockParser(mistune.block_parser.BlockParser):
"""A copy of Mistune's block parser with header parsing rules removed."""
-- RULE_NAMES = remove_header_rules(
+ RULE_NAMES = remove_header_rules(
- mistune.block_parser.BlockParser.RULE_NAMES)
-+ DEFAULT_RULES = remove_header_rules(
+ mistune.block_parser.BlockParser.DEFAULT_RULES)
- # Signature Plugin looks for signature pattern in email content and converts it
-@@ -141,10 +130,10 @@ def plugin_signature(md):
+ OUTLOOK_REPLY_PATTERN = re.compile(
+@@ -163,10 +164,10 @@ def plugin_signature(md):
It only provides an HTML renderer because that is the only one needed.
"""
@@ -216,7 +161,7 @@ Index: HyperKitty-1.3.7/hyperkitty/lib/renderer.py
md.renderer.register('signature', render_html_signature)
-@@ -189,18 +178,18 @@ def plugin_pgp_signature(md):
+@@ -211,22 +212,23 @@ def plugin_pgp_signature(md):
It parses BEGIN PGP SIGNATURE and END PGP SIGNATURE and collapses content
in between them.
"""
@@ -235,12 +180,17 @@ Index: HyperKitty-1.3.7/hyperkitty/lib/renderer.py
- inline=InlineParser(renderer, hard_wrap=False),
+ inline=InlineParser(hard_wrap=False),
block=BlockParser(),
-- plugins=[plugin_pgp_signature, plugin_signature, plugin_url])
-+ plugins=[plugin_pgp_signature, plugin_signature, url])
++
+ plugins=[
+ plugin_pgp_signature,
+ plugin_signature,
+ plugin_outlook_reply,
+- plugin_url
++ url
+ ])
- # The only difference between the markdown and this renderer is
-@@ -208,10 +197,10 @@ markdown_renderer = mistune.Markdown(
+@@ -235,10 +237,10 @@ markdown_renderer = mistune.Markdown(
# rules that results in a regularly formatted email.
text_renderer = mistune.Markdown(
renderer=renderer,
@@ -253,10 +203,10 @@ Index: HyperKitty-1.3.7/hyperkitty/lib/renderer.py
- plugin_url,
+ url,
])
-Index: HyperKitty-1.3.7/setup.py
-===================================================================
---- HyperKitty-1.3.7.orig/setup.py
-+++ HyperKitty-1.3.7/setup.py
+diff --git a/setup.py b/setup.py
+index 2d8da168..d8c2d2fb 100755
+--- a/setup.py
++++ b/setup.py
@@ -45,7 +45,7 @@ REQUIRES = [
"pytz>=2012",
"django-compressor>=1.3",
@@ -266,11 +216,293 @@ Index: HyperKitty-1.3.7/setup.py
"python-dateutil >= 2.0",
"networkx>=2.0",
"django-haystack>=2.8.0",
-Index: HyperKitty-1.3.7/hyperkitty/tests/test_templatetags.py
-===================================================================
---- HyperKitty-1.3.7.orig/hyperkitty/tests/test_templatetags.py
-+++ HyperKitty-1.3.7/hyperkitty/tests/test_templatetags.py
-@@ -147,15 +147,13 @@ class TestGravatar(TestCase):
+--
+GitLab
+
+
+From 2312689ea67f631c2aae54013a3e6a57be7ef36d Mon Sep 17 00:00:00 2001
+From: Abhilash Raj {text}
')
+
+- def emphasis(self, marker, text):
++ def emphasis(self, text, marker):
+ """Emphasis with marker included."""
+ return super().emphasis(marker + text + marker)
+
+- def strong(self, marker, text):
++ def strong(self, text, marker):
+ """Strong with marker included."""
+ return super().strong(marker + text + marker)
+
+@@ -42,7 +44,7 @@ class MyRenderer(mistune.HTMLRenderer):
+ return ''.format(
+ src=src, title=title, alt=alt)
+
+- def image(self, alt, src, title):
++ def image(self, alt, url, title=None):
+ """Render image if configured to do so.
+
+ HYPERKITTY_RENDER_INLINE_IMAGE configuration allows for
+@@ -50,10 +52,10 @@ class MyRenderer(mistune.HTMLRenderer):
+ default since embeded images can cause problems.
+ """
+ if getattr(settings, 'HYPERKITTY_RENDER_INLINE_IMAGE', False):
+- return super().image(src, alt, title, )
+- return self._md_style_img(src, title, alt)
++ return super().image(alt, url, title)
++ return self._md_style_img(url, title, alt)
+
+- def link(self, text=None, url=None, title=None):
++ def link(self, text, url, title=None):
+ """URL link renderer that truncates the length of the URL.
+
+ This only does it for the URLs that are not hyperlinks by just literal
+@@ -67,7 +69,7 @@ class MyRenderer(mistune.HTMLRenderer):
+
+ s = '' + (text or url) + ''
+
+
+@@ -79,13 +81,13 @@ class InlineParser(mistune.inline_parser.InlineParser):
+ ‘emphasis’ or ‘strong’ node.
+ """
+
+- def tokenize_emphasis(self, m, state):
+- marker = m.group(1)
+- text = m.group(2)
+- if len(marker) == 1:
+- return 'emphasis', marker, self.render(text, state)
+- return 'strong', marker, self.render(text, state)
+-
++ def parse_emphasis(self, m, state):
++ end_pos = super().parse_emphasis(m, state)
++ last_token = state.tokens[-1].copy()
++ marker = m.group(0)
++ last_token['attrs'] = {'marker': marker}
++ state.tokens[-1] = last_token
++ return end_pos
+
+ def remove_header_rules(rules):
+ rules = list(rules)
+@@ -97,7 +99,7 @@ def remove_header_rules(rules):
+
+ class BlockParser(mistune.block_parser.BlockParser):
+ """A copy of Mistune's block parser with header parsing rules removed."""
+- RULE_NAMES = remove_header_rules(
++ DEFAULT_RULES = remove_header_rules(
+ mistune.block_parser.BlockParser.DEFAULT_RULES)
+
+
+diff --git a/hyperkitty/tests/test_templatetags.py b/hyperkitty/tests/test_templatetags.py
+index 79372d84..b1d83177 100644
+--- a/hyperkitty/tests/test_templatetags.py
++++ b/hyperkitty/tests/test_templatetags.py
+@@ -156,6 +156,7 @@ On Fri, 09.11.12 11:27, Someone wrote:
+ > This is the first quoted line
+ > On Fri 07.25.12, Aperson wrote:
+ >> This is the second quoted line.
++
+ This is the response.
+ """
+ expected = (
+@@ -167,6 +168,8 @@ This is the response.
+ ''
+ '{text}
')
+@@ -62,7 +61,10 @@ class MyRenderer(mistune.HTMLRenderer):
+ URLs (text=None) so text is same as URL.
+ It also adds target=“_blank” so that the URLs open in a new tab.
+ """
+- if text is None:
++ # text can be none of same as url in case of autolink parsing. This
++ # will truncate the length of the URL in both cases but preserve
++ # the actual URL destination in the hyperlink.
++ if text is None or text == url:
+ text = url
+ if len(text) > 76:
+ text = url[:76] + '...'
+@@ -103,26 +105,26 @@ class BlockParser(mistune.block_parser.BlockParser):
+ mistune.block_parser.BlockParser.DEFAULT_RULES)
+
+
+-OUTLOOK_REPLY_PATTERN = re.compile(
++OUTLOOK_REPLY_PATTERN = (
+ r'^-------- Original message --------\n'
+- r'([\s\S]+)', # everything after newline.
+- re.M
++ r'(?P