SingleFile CLI 2.31.0
New features
-
Three template variables say what saved a page. They can be used with
--filename-templateand--infobar-template:{singlefile-name}givessingle-file-cli,{singlefile-version}gives the version of the tool and{singlefile-url}giveshttps://www.getsinglefile.com(gildas-lormeau/SingleFile#1504).single-file https://www.example.com --filename-template="{page-title} ({singlefile-name} {singlefile-version}).html"
CLI fixes and improvements
- Updated single-file-core to 1.22.0:
- an image that was displayed on the page and that could not be saved keeps its space in the saved page. It was hidden, so the content around it moved. Its source is now a transparent SVG image with the natural size the image had on the page. An image styled with a border or a background leaves an empty frame where it was. The option
--block-imagesbehaves as before - an image that was already broken on the page, for example an image answering 404, keeps its place in the saved page. It was hidden, although a broken image keeps its box on the page and still counts as a flex or grid item
- an image with a
srcsetcandidate that could not be saved was displayed as a broken image, although itssrcwas saved. Such a candidate is now removed - an image whose server answers without any body, for example a 404 error with an empty response, was saved with an empty data URI in a page, or as a file of zero bytes in a ZIP file. It is now treated like any other image without content
- in a page served as XHTML, the elements written with a namespace prefix (
<svg:svg>,<m:math>,<html:div>) are displayed in the saved page. An SVG drawing or a MathML formula written this way was missing - a page saved with
--selected-elements-selectoris smaller: the inlinesvgelements and the fonts that only the content outside the selection uses are no longer saved, and the blocks kept hidden around the selection share one stylesheet instead of carrying 12 declarations each. Ansvgelement outside the selection that had to be kept is no longer displayed next to the selected content (gildas-lormeau/SingleFile#331) - the
symbolelements of an inline SVG sprite that nothing references are removed from the saved page. They are kept with--block-scripts=falseand with--remove-hidden-elements=false(gildas-lormeau/SingleFile#331) - a blocked video inside a link no longer breaks the layout of the saved page. The link to the video file was written inside the outer link, which a link cannot contain
- an image that was displayed on the page and that could not be saved keeps its space in the saved page. It was hidden, so the content around it moved. Its source is now a transparent SVG image with the natural size the image had on the page. An image styled with a border or a background leaves an empty frame where it was. The option
cross-spawnis updated in the lockfile. It is a development dependency, the published package is not concerned.
Co-authored by Claude (Claude Code)