From 3699a295d049944944506f766b2372033bf46dd1 Mon Sep 17 00:00:00 2001 From: Dzianis <2119348+dzianisv@users.noreply.github.com> Date: Sat, 3 Aug 2024 16:40:00 +0300 Subject: [PATCH 1/3] Do not escape underscores --- poept/poept.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/poept/poept.py b/poept/poept.py index a3a8480..9079be9 100644 --- a/poept/poept.py +++ b/poept/poept.py @@ -41,9 +41,9 @@ class EmptyResponse(Exception): button_css_selector = "button[class*=SendButton]" -def to_markdown(element): +def to_markdown(element: WebElement) -> str; html = element.get_attribute('innerHTML') - text = markdownify.markdownify(html) + text = markdownify.markdownify(html, escape_underscores=False) text = re.sub(r'\[\d+\]', '', text) text = re.sub(r'\s+([\.,!?])', r'\1', text) return text From 46ef88469e3e114805d39a0e12f07eaac2c96e27 Mon Sep 17 00:00:00 2001 From: Dzianis <2119348+dzianisv@users.noreply.github.com> Date: Sat, 3 Aug 2024 17:58:45 +0300 Subject: [PATCH 2/3] Fix to_markdown --- poept/poept.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poept/poept.py b/poept/poept.py index 9079be9..05b8a76 100644 --- a/poept/poept.py +++ b/poept/poept.py @@ -41,7 +41,7 @@ class EmptyResponse(Exception): button_css_selector = "button[class*=SendButton]" -def to_markdown(element: WebElement) -> str; +def to_markdown(element: WebElement) -> str: html = element.get_attribute('innerHTML') text = markdownify.markdownify(html, escape_underscores=False) text = re.sub(r'\[\d+\]', '', text) From e25194a11384a487d6562c32fae6a3a6995969b1 Mon Sep 17 00:00:00 2001 From: Dzianis <2119348+dzianisv@users.noreply.github.com> Date: Mon, 5 Aug 2024 11:34:04 +0300 Subject: [PATCH 3/3] escape_asterisks=False --- poept/poept.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poept/poept.py b/poept/poept.py index 05b8a76..e0e0c76 100644 --- a/poept/poept.py +++ b/poept/poept.py @@ -43,7 +43,7 @@ class EmptyResponse(Exception): def to_markdown(element: WebElement) -> str: html = element.get_attribute('innerHTML') - text = markdownify.markdownify(html, escape_underscores=False) + text = markdownify.markdownify(html, escape_underscores=False, escape_asterisks=False) text = re.sub(r'\[\d+\]', '', text) text = re.sub(r'\s+([\.,!?])', r'\1', text) return text