Closed cowboysync closed 5 months ago
Thanks for the fix, could you please add some tests?
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
e375689
) 97.23% compared to head (a13f493
) 97.26%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I'd suggest and highly recommend to keep the default output of html2text close to plain-text as possible while being compatible with HTML.
html2text is a Python script that converts a page of HTML into clean, easy-to-read plain ASCII text. Better yet, that ASCII also happens to be valid Markdown (a text-to-HTML format).
While supporting superscript and subscript is a very nice addition, considering above, it would be much better to have the feature as a flag. (worth noting, many markdown parsers or renderers don't happen to have such support )
For instance flag --images-with-size
is an example of how to preserve the images with their sizes, but by default it's off.
If we can have such flexibility in this, we can have this merged and include in the next release.
CI failed to pass the tests.
As the default behavior has sup/sub tags ignored, the way of having test (html->md files) won't work since the test runner will run the HTML2Text with default configuration.
The test need to be changed to a python file like how it's done for newlines on multiple calls
. You can make a new file in the tests directory and make a function in it and call the HTML2Text class with the HTML2Text(ignore_sup_sub=False) ...
(of course you can delete the current html->md test files).
Thanks for the great contribution. I did some code cleanup to align the code with the rest of the code base and updated the changelog and documentation files.
Update init.py to support the superscript and subscript tags