Skip to content

v2.31.0

Latest

Choose a tag to compare

@gildas-lormeau gildas-lormeau released this 02 Dec 01:42

SingleFile CLI 2.31.0

New features

  • Three template variables say what saved a page. They can be used with --filename-template and --infobar-template: {singlefile-name} gives single-file-cli, {singlefile-version} gives the version of the tool and {singlefile-url} gives https://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-images behaves 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 srcset candidate that could not be saved was displayed as a broken image, although its src was 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-selector is smaller: the inline svg elements 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. An svg element outside the selection that had to be kept is no longer displayed next to the selected content (gildas-lormeau/SingleFile#331)
    • the symbol elements of an inline SVG sprite that nothing references are removed from the saved page. They are kept with --block-scripts=false and 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
  • cross-spawn is updated in the lockfile. It is a development dependency, the published package is not concerned.

Co-authored by Claude (Claude Code)