From: Muhammad Rizki <[email protected]>
To: Ammar Faizi <[email protected]>
Cc: Alviro Iskandar Setiawan <[email protected]>,
GNU/Weeb Mailing List <[email protected]>
Subject: Re: [PATCH v2 4/8] atom: Small change for fix_utf8_char()
Date: Fri, 21 Oct 2022 14:35:15 +0700 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
On 21/10/2022 13.53, Ammar Faizi wrote:
> On 10/20/22 3:38 PM, Muhammad Rizki wrote:
>> Change the parameter to unescape with boolean type and change from
>> html.escape to html.unescape for the Discord bot.
>>
>> Signed-off-by: Muhammad Rizki<[email protected]>
>> ---
>> daemon/atom/utils.py | 8 ++++----
>> 1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/daemon/atom/utils.py b/daemon/atom/utils.py
>> index a30d5cb..c95612e 100644
>> --- a/daemon/atom/utils.py
>> +++ b/daemon/atom/utils.py
>> @@ -206,7 +206,7 @@ def create_template(thread: Message, platform:
>> str, to=None, cc=None):
>> if len(ret) >= substr:
>> ret = ret[:substr] + "..."
>> - ret = fix_utf8_char(ret, platform == "telegram")
>> + ret = fix_utf8_char(ret, platform == "discord")
>> ret += border
>> return ret, files, is_patch
>> @@ -242,10 +242,10 @@ def remove_patch(tmp):
>> shutil.rmtree(tmp)
>> -def fix_utf8_char(text: str, html_escape: bool = True):
>> +def fix_utf8_char(text: str, unescape: bool = True):
>> t = text.rstrip().replace("�"," ")
>> - if html_escape:
>> - t = html.escape(html.escape(text))
>> + if unescape:
>> + t = html.unescape(html.unescape(text))
>> return t
>
> This is broken.
>
> I tested this series, but didn't have time to bisect it. After I
> managed to bisect the issue, I found that the issue is introduced
> by this patch.
>
> See before and after below, anything inside the angle brackets is
> gone. The sample is using this email:
>
> https://lore.kernel.org/io-uring/[email protected]/raw
>
> -------------
> Before this patch:
>
> #ml
> From: Jens Axboe <[email protected]>
> To: Ammar Faizi <[email protected]>
> To: Dylan Yudaken <[email protected]>
> Cc: Pavel Begunkov <[email protected]>
> Cc: GNU/Weeb Mailing List <[email protected]>
> Cc: io-uring Mailing List <[email protected]>
> Cc: Facebook Kernel Team <[email protected]>
> Cc: Dylan Yudaken <[email protected]>
>
> -------------
> After this patch:
>
> #ml
> From: Jens Axboe
> To: Ammar Faizi
> To: Dylan Yudaken
> Cc: Pavel Begunkov
> Cc: GNU/Weeb Mailing List
> Cc: io-uring Mailing List
> Cc: Facebook Kernel Team
> Cc: Dylan Yudaken
>
That's very strange
https://i.ibb.co/z57n0LJ/image.png
next prev parent reply other threads:[~2022-10-21 7:35 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-20 8:38 [PATCH v2 0/8] Fix some bugs and add some features Muhammad Rizki
2022-10-20 8:38 ` [PATCH v2 1/8] discord: Add send_text_mail_interaction() Muhammad Rizki
2022-10-20 8:38 ` [PATCH v2 2/8] discord: Add send_patch_mail_interaction() Muhammad Rizki
2022-10-20 8:38 ` [PATCH v2 3/8] discord: Add get lore mail slash command Muhammad Rizki
2022-10-20 8:38 ` [PATCH v2 4/8] atom: Small change for fix_utf8_char() Muhammad Rizki
2022-10-21 6:53 ` Ammar Faizi
2022-10-21 7:35 ` Muhammad Rizki [this message]
2022-10-21 8:25 ` Muhammad Rizki
2022-10-21 8:27 ` Ammar Faizi
2022-10-21 10:44 ` Muhammad Rizki
2022-10-21 10:50 ` Ammar Faizi
2022-10-21 10:52 ` Muhammad Rizki
2022-10-21 10:54 ` Ammar Faizi
2022-10-21 10:55 ` Muhammad Rizki
2022-10-21 10:57 ` Ammar Faizi
2022-10-21 10:58 ` Muhammad Rizki
2022-10-21 10:57 ` Muhammad Rizki
2022-10-21 11:00 ` Ammar Faizi
2022-10-21 11:12 ` Muhammad Rizki
2022-10-20 8:38 ` [PATCH v2 5/8] atom: Improve remove_patch() Muhammad Rizki
2022-10-20 8:38 ` [PATCH v2 6/8] atom: add manage_payload() Muhammad Rizki
2022-10-20 8:38 ` [PATCH v2 7/8] telegram: Fix get lore command Muhammad Rizki
2022-10-20 8:38 ` [PATCH v2 8/8] atom: Improve extract_body() Muhammad Rizki
2022-10-20 14:23 ` [PATCH v2 0/8] Fix some bugs and add some features Ammar Faizi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox