Skip to content

Commit 7ab3a0e

Browse files
committed
Merge branch 'master' into pyproject.toml
2 parents 5dfa9a5 + 14c8b25 commit 7ab3a0e

File tree

92 files changed

+498
-169
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+498
-169
lines changed

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
* text eol=lf
2+
*.bat text eol=crlf
3+
*.png -text
4+
*.pdf -text

.github/workflows/main.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: CI
2+
3+
# Controls when the action will run.
4+
on:
5+
# Triggers the workflow on push or pull request events but only for the master branch
6+
push:
7+
branches: [ master ]
8+
pull_request:
9+
branches: [ master ]
10+
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
jobs:
15+
code-quality:
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
toxenv:
20+
- black
21+
- flake8
22+
- mypy
23+
- isort
24+
env:
25+
TOXENV: ${{ matrix.toxenv }}
26+
27+
name: "Tox ${{ matrix.toxenv }}"
28+
steps:
29+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
30+
- uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 0
33+
34+
- name: setup python
35+
uses: actions/setup-python@v5
36+
with:
37+
python-version: '3.13'
38+
39+
- name: Install Requirements [${{ matrix.toxenv }}]
40+
run: pip install tox
41+
42+
- name: Tox-${{ matrix.toxenv }}
43+
run: tox
44+
# This workflow contains a single job called "build"
45+
test:
46+
# The type of runner that the job will run on
47+
runs-on: ubuntu-latest
48+
strategy:
49+
matrix:
50+
toxenv:
51+
- py39
52+
- py310
53+
- py311
54+
- py312
55+
- py313
56+
include:
57+
- toxenv: py39
58+
python-version: '3.9'
59+
- toxenv: py310
60+
python-version: '3.10'
61+
- toxenv: py311
62+
python-version: '3.11'
63+
- toxenv: py312
64+
python-version: '3.12'
65+
- toxenv: py313
66+
python-version: '3.13'
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
TOXENV: ${{ matrix.toxenv }}
70+
name: "Python ${{ matrix.python-version }} | Tox ${{ matrix.toxenv }}"
71+
72+
# Steps represent a sequence of tasks that will be executed as part of the job
73+
steps:
74+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
75+
- uses: actions/checkout@v4
76+
with:
77+
fetch-depth: 2
78+
79+
- name: setup python
80+
uses: actions/setup-python@v5
81+
with:
82+
python-version: ${{ matrix.python-version }}
83+
84+
- name: Install Requirements [Python-${{ matrix.python-version }}]
85+
run: pip install tox
86+
87+
- name: Tox-${{ matrix.toxenv }}
88+
run: tox
89+
90+
- name: Upload coverage to Codecov
91+
uses: codecov/codecov-action@v5
92+
with:
93+
flags: unittests-${{ matrix.python-version }}
94+
token: ${{ secrets.CODECOV_TOKEN }}
95+
fail_ci_if_error: true # default = false
96+
verbose: true # default = false

.github/workflows/pypi.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
jobs:
8+
release:
9+
name: Release
10+
environment:
11+
name: pypi
12+
url: https://pypi.org/project/html2text
13+
permissions:
14+
id-token: write
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- uses: actions/setup-python@v5
21+
with:
22+
python-version: '3.13'
23+
24+
- name: Build
25+
run: |
26+
python -m pip install build
27+
python -m build
28+
29+
- name: Publish package distributions to PyPI
30+
uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ dist
88
.idea
99
.coverage
1010
.coverage.*
11+
coverage.xml
1112
env/
1213
.c9/
1314
.vscode

.travis.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

AUTHORS.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,14 @@ The AUTHORS/Contributors are (and/or have been):
3232
* Jonathan Vanasco <jonathan@findmeon.com>
3333
* Jon Dufresne <jon.dufresne@gmail.com>
3434
* Edward Ross <edward@skeptric.com>
35-
* Mike Borsetti
35+
* Mike Borsetti <gh: mborsetti>
3636
* Gregory Anders <greg@gpanders.com>
37-
* Maciej Podolski https://github.com/mpodolsk
37+
* Maciej Podolski <gh: mpodolsk>
38+
* Ludovic VAUGEOIS PEPIN <gh: ulodciv>
39+
* Ryan Barrett <gh: snarfed>
40+
* Edward Ross <gh: EdwardJRoss>
41+
* Gregory Anders <gh: gpanders>
42+
* Alex Vandiver <gh: alexmv>
3843

3944
Maintainer:
4045

ChangeLog.rst

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
UNRELEASED
2-
==========
1+
2024.2.26
2+
=========
3+
----
4+
5+
* Fixes #409: IndexError on empty strong mark.
6+
7+
8+
2024.2.25
9+
=========
310
----
411

512
* Fix #332: Insert at most one space for multiple emphasis
@@ -8,9 +15,17 @@ UNRELEASED
815
* Fix extra line breaks inside html link text (between '[' and ']')
916
* Fix #344: indent ``<ul>`` inside ``<ol>`` three spaces instead of two to comply with CommonMark, GFM, etc.
1017
* Fix #324: unnecessary spaces around ``<b>``, ``<em>``, and ``strike`` tags.
18+
* Don't wrap tables by default and add a ``--wrap-tables`` config option.
19+
* Feature #198: Ignore ``<p>`` tags inside table rows.
1120
* Don't wrap tables by default and add a ``--wrap-tables`` config option
12-
* Fix #320 padding empty tables and tables with no </tr> tags.
21+
* Remove support for Python ≤ 3.5. Now requires Python 3.6+.
22+
* Support for Python 3.10+.
23+
* Fix #320 padding empty tables and tables with no ``</tr>`` tags.
1324
* Add ``ignore_mailto_links`` config option to ignore ``mailto:`` style links.
25+
* Feature #407: Support the superscript and subscript tags.
26+
* Fix #373: ``\n`` inside text of a Markdown link.
27+
* Feature #406: Improve support for null atttibute values.
28+
1429

1530

1631
2020.1.16

README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
# html2text
22

3-
[![Build Status](https://secure.travis-ci.org/Alir3z4/html2text.png)](https://travis-ci.org/Alir3z4/html2text)
4-
[![Coverage Status](https://coveralls.io/repos/Alir3z4/html2text/badge.png)](https://coveralls.io/r/Alir3z4/html2text)
5-
[![Downloads](http://badge.kloud51.com/pypi/d/html2text.png)](https://pypi.org/project/html2text/)
6-
[![Version](http://badge.kloud51.com/pypi/v/html2text.png)](https://pypi.org/project/html2text/)
7-
[![Wheel?](http://badge.kloud51.com/pypi/wheel/html2text.png)](https://pypi.org/project/html2text/)
8-
[![Format](http://badge.kloud51.com/pypi/format/html2text.png)](https://pypi.org/project/html2text/)
9-
[![License](http://badge.kloud51.com/pypi/license/html2text.png)](https://pypi.org/project/html2text/)
3+
[![CI](https://github.com/Alir3z4/html2text/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/Alir3z4/html2text/actions/workflows/main.yml)
4+
[![codecov](https://codecov.io/gh/Alir3z4/html2text/graph/badge.svg?token=OoxiyymjgU)](https://codecov.io/gh/Alir3z4/html2text)
5+
106

117

128
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).

docs/usage.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ Command line options
136136
| `--single-line-break` | Use a single line break after a block element rather than two.
137137
| `--reference-links` | Use reference links instead of inline links to create markdown
138138
| `--ignore-emphasis` | Ignore all emphasis formatting in the html.
139+
| `--include-sup-sub` | Include `<sub>` and `<sup>` tags.
139140
| `-e`, `--asterisk-emphasis` | Use asterisk rather than underscore to emphasize text
140141
| `--unicode-snob` | Use unicode throughout instead of ASCII
141142
| `--no-automatic-links` | Do not use automatic links like <https://www.google.com/>

0 commit comments

Comments
 (0)