• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

petl-developers / petl / 43493020630
94%

Build:
DEFAULT BRANCH: master
Ran 13 Nov 2026 07:33PM UTC
Jobs 1
Files 136
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

13 Nov 2026 07:31PM UTC coverage: 93.755% (-0.02%) from 93.772%
43493020630

push

github

web-flow
fix: HTML-escape cell and header text in tohtml()/teehtml() (#798)

What was wrong:

`tohtml()`/`teehtml()` interpolate header and cell text straight into
`<th>%s</th>`/`<td>%s</td>` with no escaping (see #797 for the repro),
so:

- `AT&T` renders as `AT&T` at best (bare `&` is invalid HTML),
- `<b>bold` escapes its own `<td>` and corrupts the table,
- `<script>alert(1)</script>` executes when the file is viewed.

Cell data is *data* — a table renderer's basic contract is that it stays
inside its cells. pandas' `to_html`, `tabulate` and prettytable all
escape by default for this reason.

The fix was applied in `html.escape()` on:

- the header text in `_write_begin` (after `index_header`/`truncate`
processing), and
- the `vrepr()` output of each value in `_write_row` (after `truncate`,
so entities never get cut in half).

Deliberately **not** escaped: the user-supplied *formatting* inputs
(`caption`, `tr_style`, `td_styles`), which stay usable as HTML/CSS —
same split as pandas. The numeric right-alignment style path is
unchanged.

Co-authored-by: Rahul Ranjan <11793455+rahul05ranjan@users.noreply.github.com>

29 of 33 new or added lines in 2 files covered. (87.88%)

1 existing line in 1 file now uncovered.

16859 of 17982 relevant lines covered (93.75%)

0.94 hits per line

Uncovered Changes

Lines Coverage ∆ File
4
82.31
-1.97% petl/io/html.py

Coverage Regressions

Lines Coverage ∆ File
1
91.03
-1.28% petl/comparison.py
Jobs
ID Job ID Ran Files Coverage
1 43493020630.1 13 Nov 2026 07:34PM UTC 136
93.75
GitHub Action Run
Source Files on build 43493020630
  • Tree
  • List 136
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • b1aad04a on github
  • Prev Build on master (#43492268764)
  • Next Build on master (#43495886813)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc