Files
business-suite/BUGS.md
T
Marc WäckerlinandClaude Opus 5.5 d7aac52ac7 1.0.2: converter searches no subfolders, safer filters, forms, links and watermark
A document at the root of a checkout of 68377 folders needed 56 minutes,
because the converter named the suite, the document folder and the build folder
with `//` in TEXINPUTS; it now names them without recursion and the same
document converts in 11.5 seconds. A file below the document no longer replaces
a package of TeX Live.

The security review of the pending changes found four defects, each fixed with
a test proven red against the old files and green against the new ones twice:
an HTML table read in an empty sandbox, so an iframe opens no address; form
labels written through the LaTeX writer, so they are set as text; the form
pattern scans a line once instead of quadratically; a kept build folder no
longer lays the links of an earlier drawing over a new one. The form tests
remove the PDF of an earlier run before each conversion.

Also carried: forms out of Markdown, link colours from the company, clickable
links in prose, HTML tables and SVG drawings, the watermark, and the further
changes of 1.0.1 and 1.0.2 in the CHANGELOG.

npm test: 1232 of 1232 checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 12:14:55 +01:00

39 lines
3.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Bugs
Defects of the suite, each with its cause, its correction and the test that measures it.
## Search through every folder below the document
- **Found:** 2026-11-14, converting a document at the root of a checkout of 68377 folders: the conversion took 56 minutes 24 seconds, of which the probe 12 minutes 39 seconds and the first of the two LaTeX runs of the document 21 minutes 41 seconds.
- **Cause:** the converter named the suite, the folder of the document and the build folder in `TEXINPUTS` with a trailing `//`. kpathsea expands such an entry into every folder below it and tries each file name in all of them before the TeX tree, which comes last: one lookup of `fontspec.sty` took 257 seconds instead of 0.15. A file named like a package of TeX Live anywhere below the document replaced that package, and a package in a test build of the suite could serve as the identity of a company.
- **Fix:** the converter names the package folder of the suite, the folder of the document and the build folder without `//`. The same document converts in 11.5 seconds.
- **Test:** `tests/md2pdf.py` › `subfolders` (F11.16).
## An HTML table opens the address of an iframe
- **Found:** 2026-11-14, in the security review of the HTML table filter: a cell with `<iframe src="http://127.0.0.1:…/page.html">` made the build send a GET to that address and put the page into the PDF.
- **Cause:** `bin/html.lua` read the raw table with the HTML reader of pandoc in the global environment, which fetches what an iframe names.
- **Fix:** the table is read in an empty sandbox.
- **Test:** `tests/md2pdf.py` › `html_sandbox` (F11.14).
## A form label is read as LaTeX
- **Found:** 2026-11-14, in the security review of the form filter: a label `Notes}\input{<file>}\iffalse` put the file into the PDF, and a `%`, `&` or `#` in a label stopped the build.
- **Cause:** `bin/forms.lua` wrote the label into `\businessremark`, `\businessline` and `\businesslabelwidth` as it stood.
- **Fix:** every label is written through the LaTeX writer of pandoc, which escapes it.
- **Test:** `tests/forms.py` › `labels` (F13.4).
## The form pattern takes quadratic time on a long line
- **Found:** 2026-11-14, in the security review of the converter: 0.29 seconds for a line of 20000 characters, 1.01 for 40000, 3.6 for 100000.
- **Cause:** `^.*\S.*:` in the pattern `FORM` of `bin/md2pdf.py` tried every split of a line between its two `.*`.
- **Fix:** the label part scans a line once and matches the same lines.
- **Test:** `tests/md2pdf.py` › `form_pattern` (F13.5).
## A kept build folder lays old drawing links over a new drawing
- **Found:** 2026-11-14, in the security review of the drawing filter.
- **Cause:** the drawings are numbered from one in every run, and `bin/svg.lua` wrote no link file for a drawing without links, so with `--keep-tex` the file of the earlier drawing of that number stayed and the template read it.
- **Fix:** the link file of the drawing is removed before the links are written.
- **Test:** `tests/md2pdf.py` › `stale_links` (F11.17).