Skip to content

Commit

Permalink
DiscordChatExporter 2.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mahtoid committed Jul 11, 2023
1 parent 1aa570b commit 51e85d3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion chat_exporter/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from chat_exporter.chat_exporter import export, raw_export, quick_export, link, quick_link

__version__ = "2.6.0"
__version__ = "2.6.1"

__all__ = (
export,
Expand Down
2 changes: 1 addition & 1 deletion chat_exporter/construct/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ async def build_reference(self):
("NAME_TAG", await discriminator(message.author.name, message.author.discriminator), PARSE_MODE_NONE),
("NAME", str(html.escape(message.author.display_name))),
("USER_COLOUR", user_colour, PARSE_MODE_NONE),
("CONTENT", message.content, PARSE_MODE_REFERENCE),
("CONTENT", message.content.replace("\n", "").replace("<br>", ""), PARSE_MODE_REFERENCE),
("EDIT", message_edited_at, PARSE_MODE_NONE),
("ICON", icon, PARSE_MODE_NONE),
("USER_ID", str(message.author.id), PARSE_MODE_NONE),
Expand Down
12 changes: 6 additions & 6 deletions chat_exporter/parse/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async def parse_emoji(self):
match = re.search(p, self.content)

def strip_preserve(self):
p = r'<span class="chatlog__markdown-preserve">(.*?)</span>'
p = r'<span class="chatlog__markdown-preserve">(.*)</span>'
r = '%s'

pattern = re.compile(p)
Expand Down Expand Up @@ -124,15 +124,15 @@ def order_list_markdown_to_html(self):
self.content = html

def parse_normal_markdown(self):
self.order_list_markdown_to_html()
# self.order_list_markdown_to_html()
holder = (
[r"__(.*?)__", '<span style="text-decoration: underline">%s</span>'],
[r"\*\*(.*?)\*\*", '<strong>%s</strong>'],
[r"\*(.*?)\*", '<em>%s</em>'],
[r"~~(.*?)~~", '<span style="text-decoration: line-through">%s</span>'],
[r"###\s(.*?)\n", '<h3>%s</h1>'],
[r"##\s(.*?)\n", '<h2>%s</h1>'],
[r"#\s(.*?)\n", '<h1>%s</h1>'],
# [r"###\s(.*?)\n", '<h3>%s</h1>'],
# [r"##\s(.*?)\n", '<h2>%s</h1>'],
# [r"#\s(.*?)\n", '<h1>%s</h1>'],
[r"\|\|(.*?)\|\|", '<span class="spoiler spoiler--hidden" onclick="showSpoiler(event, this)"> <span '
'class="spoiler-text">%s</span></span>'],
)
Expand Down Expand Up @@ -309,7 +309,7 @@ def order_list_html_to_markdown(content):
return html

def return_to_markdown(self, content):
content = self.order_list_html_to_markdown(content)
# content = self.order_list_html_to_markdown(content)
holders = (
[r"<strong>(.*?)</strong>", '**%s**'],
[r"<em>([^<>]+)</em>", '*%s*'],
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "chat_exporter"
description = "A simple Discord chat exporter for Python Discord bots."
version = "2.6.0"
version = "2.6.1"
readme = "README.md"
authors = [
{ name="mahtoid", email="[email protected]" }
Expand Down

0 comments on commit 51e85d3

Please sign in to comment.