Skip to content

Commit

Permalink
fix ci failure and modify the cli argument from "--ignore-sup-sub" to…
Browse files Browse the repository at this point in the history
… "--no-ignore-sup-sub"
  • Loading branch information
cowboysync committed Jan 26, 2024
1 parent b2a1dda commit a13f493
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion html2text/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
Expand Down Expand Up @@ -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))
5 changes: 5 additions & 0 deletions test/test_html2text.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit a13f493

Please sign in to comment.