From a13f49319629e06d579e4c685c72caa15e476623 Mon Sep 17 00:00:00 2001 From: cowboysync <31790726+cowboysync@users.noreply.github.com> Date: Fri, 26 Jan 2024 10:44:43 +0800 Subject: [PATCH] fix ci failure and modify the cli argument from "--ignore-sup-sub" to "--no-ignore-sup-sub" --- html2text/cli.py | 4 +++- test/test_html2text.py | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/html2text/cli.py b/html2text/cli.py index 2708c40..193b3d3 100644 --- a/html2text/cli.py +++ b/html2text/cli.py @@ -265,8 +265,9 @@ class bcolors: p.add_argument("filename", nargs="?") p.add_argument("encoding", nargs="?", default="utf-8") p.add_argument( - "--ignore-sup-sub", + "--no-ignore-sup-sub", dest="ignore_sup_sub", + action="store_false", default=config.IGNORE_SUP_SUB, help="Ignore the sup and sub tags", ) @@ -324,5 +325,6 @@ class bcolors: h.default_image_alt = args.default_image_alt h.open_quote = args.open_quote h.close_quote = args.close_quote + h.ignore_sup_sub = args.ignore_sup_sub sys.stdout.write(h.handle(html)) diff --git a/test/test_html2text.py b/test/test_html2text.py index f57cb6b..249a053 100644 --- a/test/test_html2text.py +++ b/test/test_html2text.py @@ -140,6 +140,11 @@ def generate_testdata(): # CLI doesn't support baseurl. cmdline_args = skip + if base_fn in ["sup_tag.html", "sub_tag.html"]: + module_args["ignore_sup_sub"] = False + cmdline_args.append("--no-ignore-sup-sub") + func_args = skip + yield fn, module_args, cmdline_args, func_args